JM9 XRCU Board 0.1.0
Libraries API Reference
Loading...
Searching...
No Matches
CompoI.h
Go to the documentation of this file.
1
8
9#ifndef COMPOI_H
10#define COMPOI_H
11
12#include <Arduino.h>
13#include <Wire.h>
14
15#include <Supported_sensor.h>
16
21class CompoI : public Supported_sensor {
22 private:
26 const uint32_t port;
27
31 uint8_t i2c_address;
32
36 uint8_t prev_data_list [21];
37
41 uint8_t prev_vector_dir;
42
51 uint8_t command (const uint8_t cmd);
52
53 public:
59 CompoI (const uint32_t init_port);
60
68 void begin (const uint8_t init_i2c_address = 0x02);
69
74 bool test_comm ();
75
82 uint8_t get_channel_val (const uint8_t channel);
83
88 uint8_t get_max_idx ();
89
95 uint8_t get_max_val ();
96
101 uint8_t get_min_idx ();
102
108 uint8_t get_min_val ();
109
115 uint8_t get_avg_val ();
116
124 uint8_t set_filter_on ();
132 uint8_t set_filter_off ();
133
141 uint8_t calibrate ();
142
149 uint8_t set_addr_0x01 ();
150
157 uint8_t set_addr_0x02 ();
158
159 // /**
160 // * This setting is saved and re-applied if the module is reset or power-off-power-on.
161 // *
162 // * @brief Disables vector algorithm.
163 // * @return undefined
164 // * @ d e p r e c a t e d
165 // */
166 // uint8_t disable_vectors ();
167
168 // /**
169 // * This setting is saved and re-applied if the module is reset or power-off-power-on.
170 // *
171 // * @brief Enables vector algorithm.
172 // * @return undefined
173 // * @ d e p r e c a t e d
174 // */
175 // uint8_t enable_vectors ();
176
183 uint8_t turn_off_leds ();
184
191 uint8_t turn_on_leds ();
192
197 uint8_t get_ball_angle ();
198
207 uint32_t read_eeprom ();
208
213 uint8_t reset ();
214};
215
216#endif // #ifndef COMPOI_H
uint8_t get_max_idx()
Gets the channel number that reads the strongest IR intensity.
Definition CompoI.cpp:173
uint8_t set_addr_0x02()
Sets I2C address of the module to 0x02.
Definition CompoI.cpp:209
uint8_t get_max_val()
Gets the strongest IR intensity reading among all channels.
Definition CompoI.cpp:177
uint8_t set_addr_0x01()
Sets I2C address of the module to 0x01.
Definition CompoI.cpp:205
uint8_t turn_off_leds()
Disables vector algorithm.
Definition CompoI.cpp:221
uint8_t get_min_val()
Gets the weakest IR intensity reading among all channels.
Definition CompoI.cpp:185
uint8_t get_avg_val()
Gets the mean average IR intensity reading of all channels.
Definition CompoI.cpp:189
uint8_t reset()
Software resets the module.
Definition CompoI.cpp:287
void begin(const uint8_t init_i2c_address=0x02)
Activates this compound eye module.
Definition CompoI.cpp:152
uint32_t read_eeprom()
Gets the EEPROM values.
Definition CompoI.cpp:256
bool test_comm()
Checks whether communication is established.
Definition CompoI.cpp:159
uint8_t set_filter_on()
Turns on the signal filter.
Definition CompoI.cpp:193
uint8_t get_ball_angle()
Gets the ball angle.
Definition CompoI.cpp:229
uint8_t get_channel_val(const uint8_t channel)
Reads the IR intensity of a specific channel.
Definition CompoI.cpp:169
uint8_t calibrate()
Initializes the hardware.
Definition CompoI.cpp:201
uint8_t set_filter_off()
Turns off the signal filter.
Definition CompoI.cpp:197
CompoI(const uint32_t init_port)
Creates a CompoI object.
Definition CompoI.cpp:137
uint8_t get_min_idx()
Gets the channel number that reads the weakest IR intensity.
Definition CompoI.cpp:181
uint8_t turn_on_leds()
Turns on LEDs.
Definition CompoI.cpp:225
Supported_sensor()
Creates an object of a supported sensor.
Definition Supported_sensor.h:23