C4EV3
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
ev3_sensors.h
Go to the documentation of this file.
1 
6 #ifndef EV3_API_EV3_SENSORS_H
7 #define EV3_API_EV3_SENSORS_H
8 
9 #include <stdbool.h>
10 #include "../../include/ev3_constants.h"
11 
12 #define NONE_MODE -1
13 
14 
15 typedef struct SensorHandler {
16  bool (*Init)(int port);
17  void (*Exit)(int port);
18 
33 
40 bool SetSensor (int port, SensorHandler * sensor);
41 
42 SensorHandler * GetSensor (int port);
43 
44 bool SetAllSensors (SensorHandler * port1, SensorHandler * port2, SensorHandler * port3, SensorHandler * port4);
45 
46 #include "ev3_touch.h"
47 #include "ev3_color.h"
48 #include "ev3_ir.h"
49 #include "ht_ir.h"
50 #include "ev3_ultrasonic.h"
51 #include "ev3_gyro.h"
52 #include "nxt_temperature.h"
53 #include "nxt_sound.h"
54 #include "ht_compass.h"
55 #include "ht_color.h"
56 #include "pixy_cam.h"
57 #include "back_compatibility.h"
58 
59 #endif //EV3_API_EV3_SENSORS_H
bool(* Init)(int port)
Definition: ev3_sensors.h:16
Back-compatible functions to read sensors like in the original c4ev3.
bool SetSensor(int port, SensorHandler *sensor)
SensorHandler * GetSensor(int port)
struct SensorHandler SensorHandler
#define NUM_INPUTS
Definition: ev3_constants.h:44
bool SetAllSensors(SensorHandler *port1, SensorHandler *port2, SensorHandler *port3, SensorHandler *port4)
Definition: ev3_sensors.h:15
void(* Exit)(int port)
Definition: ev3_sensors.h:17
int currentSensorMode[NUM_INPUTS]
Definition: ev3_sensors.h:31