Compound Eye Driver for XRCU. More...
#include <CompoI.h>
Public Member Functions | |
| CompoI (const uint32_t init_port) | |
| Creates a CompoI object. | |
| void | begin (const uint8_t init_i2c_address=0x02) |
| Activates this compound eye module. | |
| bool | test_comm () |
| Checks whether communication is established. | |
| uint8_t | get_channel_val (const uint8_t channel) |
| Reads the IR intensity of a specific channel. | |
| uint8_t | get_max_idx () |
| Gets the channel number that reads the strongest IR intensity. | |
| uint8_t | get_max_val () |
| Gets the strongest IR intensity reading among all channels. | |
| uint8_t | get_min_idx () |
| Gets the channel number that reads the weakest IR intensity. | |
| 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. | |
| uint8_t | set_filter_on () |
| Turns on the signal filter. | |
| uint8_t | set_filter_off () |
| Turns off the signal filter. | |
| uint8_t | calibrate () |
| Initializes the hardware. | |
| uint8_t | set_addr_0x01 () |
| Sets I2C address of the module to 0x01. | |
| uint8_t | set_addr_0x02 () |
| Sets I2C address of the module to 0x02. | |
| uint8_t | turn_off_leds () |
| Turns off LEDs. | |
| uint8_t | turn_on_leds () |
| Turns on LEDs. | |
| uint8_t | get_ball_angle () |
| Gets the ball angle. | |
| uint32_t | read_eeprom () |
| Gets the EEPROM values. | |
| uint8_t | reset () |
| Software resets the module. | |
Additional Inherited Members | |
Protected Member Functions inherited from Supported_sensor | |
| Supported_sensor () | |
| Creates an object of a supported sensor. | |
Protected Member Functions inherited from Supported_module | |
| Supported_module () | |
| Creates an object of a supported module. | |
Compound Eye Driver for XRCU.
| CompoI::CompoI | ( | const uint32_t | init_port | ) |
Creates a CompoI object.
| init_port | the I2C port connected to this compound eye module |
| void CompoI::begin | ( | const uint8_t | init_i2c_address = 0x02 | ) |
Activates this compound eye module.
YOU MUST CALL ME IN void setup () FUNCTION TO USE THIS OBJECT PROPERLY. Configures the settings of the I2C bus and the chip.
| init_i2c_address | the 7-bit I2C address of this compound eye module |
| uint8_t CompoI::calibrate | ( | ) |
Initializes the hardware.
This is already completed at the factory. There is no need for the user to call this method.
| uint8_t CompoI::get_avg_val | ( | ) |
Gets the mean average IR intensity reading of all channels.
| uint8_t CompoI::get_ball_angle | ( | ) |
Gets the ball angle.
| uint8_t CompoI::get_channel_val | ( | const uint8_t | channel | ) |
Reads the IR intensity of a specific channel.
| channel | the channel number of compound-eye to read its value [1 : 7] |
| uint8_t CompoI::get_max_idx | ( | ) |
Gets the channel number that reads the strongest IR intensity.
| uint8_t CompoI::get_max_val | ( | ) |
Gets the strongest IR intensity reading among all channels.
| uint8_t CompoI::get_min_idx | ( | ) |
Gets the channel number that reads the weakest IR intensity.
| uint8_t CompoI::get_min_val | ( | ) |
Gets the weakest IR intensity reading among all channels.
| uint32_t CompoI::read_eeprom | ( | ) |
Gets the EEPROM values.
This method is for internal use such as menu use only. The returned values do not provide a guaranteed meaning and are subject to change without notice.
| uint8_t CompoI::reset | ( | ) |
Software resets the module.
| uint8_t CompoI::set_addr_0x01 | ( | ) |
Sets I2C address of the module to 0x01.
This setting is saved and re-applied if the module is reset or power-off-power-on.
| uint8_t CompoI::set_addr_0x02 | ( | ) |
Sets I2C address of the module to 0x02.
This setting is saved and re-applied if the module is reset or power-off-power-on.
| uint8_t CompoI::set_filter_off | ( | ) |
Turns off the signal filter.
Disables smoothing of signal ripples. This setting is saved and re-applied if the module is reset or power-off-power-on.
| uint8_t CompoI::set_filter_on | ( | ) |
Turns on the signal filter.
Enables smoothing of signal ripples. This setting is saved and re-applied if the module is reset or power-off-power-on.
| bool CompoI::test_comm | ( | ) |
Checks whether communication is established.
true if communication with the module is established, false otherwise | uint8_t CompoI::turn_off_leds | ( | ) |
Turns off LEDs.
This setting is saved and re-applied if the module is reset or power-off-power-on.
| uint8_t CompoI::turn_on_leds | ( | ) |
Turns on LEDs.
This setting is saved and re-applied if the module is reset or power-off-power-on.