26 float filtered_output;
27 float prev_filtered_output;
31 const int sample_count_;
32 const float detect_range_;
33 const float angle_coeff;
36 float cali_min[6] = {0.15, 0.15, 0.15, 0.15, 0.15, 0.15};
37 float cali_max[6] = {0.90, 0.90, 0.90, 0.90, 0.90, 0.90};
38 const int coef[6] = {5, 3, 1, -1, -3, -5};
50 const float LP_a0 = 0.63946321;
51 const float LP_b0 = 0.1802684;
52 const float LP_b1 = 0.1802684;
61 float read(AnalogIn sensor);
74 SensorArray(PinName sens0, PinName sens1, PinName sens2, PinName sens3, PinName sens4, PinName sens5,
75 PinName led0, PinName led1, PinName led2, PinName led3, PinName led4, PinName led5,
int sample_count,
float detect_range,
float angle_coefficient);
Represents an array of sensors with corresponding LEDs for detection.
void calibrate_sensors(void)
SensorArray(PinName sens0, PinName sens1, PinName sens2, PinName sens3, PinName sens4, PinName sens5, PinName led0, PinName led1, PinName led2, PinName led3, PinName led4, PinName led5, int sample_count, float detect_range, float angle_coefficient)
Constructs a new SensorArray object.
float get_array_output(void)
Gets the output value of the sensor array.
float * get_sens_output_array(void)
Gets an array of sensor output values.
float get_filtered_output(void)
void update(void)
Updates the sensor array.
float get_sens_output(int index)
Gets the output value of a sensor at the specified index.
float * get_calibration_constants(void)
bool is_line_detected(void)
Checks if a line is detected (in the last update).
void set_all_led_on(bool status)
Sets the status of all LEDs.
void reset(void)
Resets the sensor array.