36 uint8_t prev_data_list [21];
41 uint8_t prev_ball_angle;
46 int16_t prev_ball_angle_360;
51 int16_t prev_ball_vector_mag;
56 int16_t prev_max_val_360;
61 int16_t prev_avg_val_360;
66 int16_t prev_resistance;
71 int16_t prev_channel_vals [12];
76 static const uint8_t DEFAULT_I2C_ADDRESS;
81 static const uint32_t I2C_FREQ;
86 static const uint32_t MODULE_RESPONSE_TIMEOUT_US;
91 static const uint32_t INTERVAL_BETWEEN_RETRIES_US;
100 bool query (
const uint8_t cmd,
const uint8_t rx_len);
108 bool try_send_command (
const uint8_t cmd,
const uint8_t rx_len = 0);
118 uint8_t command (
const uint8_t cmd);
135 void begin (
const uint8_t init_i2c_address = DEFAULT_I2C_ADDRESS);
uint8_t get_max_idx()
Gets the channel number that reads the strongest IR intensity.
int16_t get_channel_val_360(const uint8_t channel)
Reads the IR intensity of a specific channel.
void set_resistance(const int16_t r)
Sets the resistance in series to photodiode.
int16_t get_avg_val_360()
Gets the mean average IR intensity reading of all channels.
uint16_t get_product_code()
Gets the JM9 product number of the connected module.
void set_filter_off()
Turns off the signal filter to see fire flames and sunlight only.
uint8_t get_max_val()
Gets the strongest IR intensity reading among all channels.
void begin(const uint8_t init_i2c_address=DEFAULT_I2C_ADDRESS)
Activates this compound eye module.
void set_addr_0x01()
Sets I2C address of the module to 0x01.
int16_t get_ball_angle_360()
Gets the ball angle from the entire circle.
uint8_t get_min_val()
Gets the weakest IR intensity reading among all channels.
uint8_t get_avg_val()
Gets the mean average IR intensity reading of all channels.
void calibrate()
Initializes the hardware.
uint32_t read_eeprom()
Gets the EEPROM values.
bool test_comm()
Checks whether communication is established.
int16_t get_ball_vector_mag()
Gets the ball strength calculated from vector algorithm.
void turn_off_leds()
Turns off LEDs.
int16_t get_max_val_360()
Gets the strongest IR intensity reading among all channels.
uint8_t get_ball_angle()
Gets the ball angle.
void reset()
Software resets the module.
uint8_t get_channel_val(const uint8_t channel)
Reads the IR intensity of a specific channel.
int16_t get_resistance()
Gets the resistance in series to photodiode.
bool are_leds_on()
Checks whether the LEDs are turned on or not.
CompoI(const uint32_t init_port)
Creates a CompoI object.
void enable_vectors()
Enables the vector algorithm.
void disable_vectors()
Disables the vector algorithm.
void set_addr_0x02()
Sets I2C address of the module to 0x02.
void set_filter_on()
Turns on the signal filter to see IR balls only.
uint8_t get_min_idx()
Gets the channel number that reads the weakest IR intensity.
void turn_on_leds()
Turns on LEDs.
bool is_filter_on()
Checks whether the signal filter is turned on or not.
Supported_sensor()
Creates an object of a supported sensor.
Definition Supported_sensor.h:23