13#define PRESCALER 10.0f
17#define WHITE_TRESHOLD 0.8
20#define _SENSORS_DEBUG 1
22#define _SENSORS_DEBUG 0
58 Sensor(PinName p1, PinName p2, PinName p3, PinName p4, PinName p5, PinName p6,
59 PinName in1, PinName in2, PinName in3, PinName in4, PinName in5, PinName in6);
Sensor class to handle the sensor readings.
Definition: sensor.h:30
float getDistance() const
Get the distance.
void calibrateWhite()
Calibrate the sensors on white area of the track.
static std::array< float, 6 > SCALE_FACTOR
Array of constant scale factor for sensors.
Definition: sensor.h:68
float read()
Read the sensor values.
int m_notrackcounter
No track counter.
Definition: sensor.h:48
static std::array< float, 6 > BLACK_TRESHOLD
Array of constant black threshold for sensors.
Definition: sensor.h:65
static std::array< float, 6 > WEIGHTS
Array of constant weights for sensors.
Definition: sensor.h:62
int getNoTrackCounter() const
Get the no track counter value.
BusOut m_pins
Array of sensors DigitalOut.
Definition: sensor.h:33
std::array< float, 6 > m_noise
Array of sensors noise.
Definition: sensor.h:42
float m_distance
Sensor position.
Definition: sensor.h:45
std::array< AnalogIn, 6 > m_analog
Array of sensors AnalogIn.
Definition: sensor.h:36
void calibrateBlack()
Calibrate the sensors on black area of the track.
std::array< float, 6 > m_reading
Array of sensors readings.
Definition: sensor.h:39
static bool s_run
Debugging flag for printing headers.
Definition: sensor.h:71
Sensor(PinName p1, PinName p2, PinName p3, PinName p4, PinName p5, PinName p6, PinName in1, PinName in2, PinName in3, PinName in4, PinName in5, PinName in6)
Constructor.