![]() |
MatrixMiniR4 1.1.5
Matrix Mini R4 Arduino Library API Documentation
|
Class for interacting with a color sensor. More...
#include <MiniR4ColorSensorExt.h>
Public Member Functions | |
bool | begin () |
Initializes the color sensor. | |
void | setGamma (bool state) |
Sets the gamma correction state for the sensor. | |
void | setLight (bool state, bool mode, uint8_t pwm) |
Sets the light state and mode for the sensor. | |
uint8_t | getColor (ColorType color) |
Gets the value of a specific color from the sensor. | |
uint8_t | getGrayscale () |
Gets the grayscale value from the sensor. | |
uint8_t | getColorNumber () |
Gets the number of colors supported by the sensor. Number of color as follow as below: 0:Black, 1:White, 2:Cyan, 3:Ocean, 4:Blue, 5:Violet, 6:Magenta 7:Raspberry, 8:Red, 9:Orange, 10:Yellow, 11:Spring, 12:Green, 13:Turquoise. | |
Public Attributes | |
uint8_t | _ch = 0 |
TwoWire * | _pWire |
Class for interacting with a color sensor.
This class provides methods to initialize the sensor, configure settings, and retrieve color values from the sensor.
Definition at line 36 of file MiniR4ColorSensorExt.h.
bool MatrixColor::begin | ( | ) |
Initializes the color sensor.
Definition at line 8 of file MiniR4ColorSensorExt.cpp.
uint8_t MatrixColor::getColor | ( | ColorType | color | ) |
Gets the value of a specific color from the sensor.
color | The color type to retrieve. |
Definition at line 53 of file MiniR4ColorSensorExt.cpp.
uint8_t MatrixColor::getColorNumber | ( | ) |
Gets the number of colors supported by the sensor. Number of color as follow as below: 0:Black, 1:White, 2:Cyan, 3:Ocean, 4:Blue, 5:Violet, 6:Magenta 7:Raspberry, 8:Red, 9:Orange, 10:Yellow, 11:Spring, 12:Green, 13:Turquoise.
Definition at line 65 of file MiniR4ColorSensorExt.cpp.
uint8_t MatrixColor::getGrayscale | ( | ) |
Gets the grayscale value from the sensor.
Definition at line 60 of file MiniR4ColorSensorExt.cpp.
void MatrixColor::setGamma | ( | bool | state | ) |
Sets the gamma correction state for the sensor.
state | true to enable gamma correction, false to disable it. |
Definition at line 23 of file MiniR4ColorSensorExt.cpp.
void MatrixColor::setLight | ( | bool | state, |
bool | mode, | ||
uint8_t | pwm ) |
Sets the light state and mode for the sensor.
state | true to turn on the light, false to turn it off. |
mode | The mode of the light (e.g., PWM). |
pwm | The PWM value to set the light brightness. |
Definition at line 34 of file MiniR4ColorSensorExt.cpp.
uint8_t MatrixColor::_ch = 0 |
Definition at line 61 of file MiniR4ColorSensorExt.h.
TwoWire* MatrixColor::_pWire |
Definition at line 62 of file MiniR4ColorSensorExt.h.