![]() |
MatrixMiniR4 1.1.9
Matrix Mini R4 Arduino Library API Documentation
|
Class for HiTechnic NXT Color Sensor V2 functions. More...
#include <MiniR4_HTColV2.h>
Public Member Functions | |
void | begin () |
Initialize the color sensor. | |
void | setMode (uint8_t mode=HTCOLV2_MODE_RGB) |
Set the sensor mode. | |
uint8_t | getColorNumber () |
Get the color number detected by the sensor. | |
uint8_t | getR () |
Get the red component value. | |
uint8_t | getG () |
Get the green component value. | |
uint8_t | getB () |
Get the blue component value. | |
void | getRGB (uint8_t &r, uint8_t &g, uint8_t &b) |
Get all RGB values at once. | |
float | getH () |
Get the hue value (H in HSV) | |
float | getS () |
Get the saturation value (S in HSV) | |
float | getV () |
Get the brightness/value (V in HSV) | |
void | getHSV (float &h, float &s, float &v) |
Get all HSV values at once. | |
Public Attributes | |
uint8_t | _ch = 0 |
I2C multiplexer channel. | |
TwoWire * | _pWire |
Pointer to Wire object. | |
Class for HiTechnic NXT Color Sensor V2 functions.
Definition at line 38 of file MiniR4_HTColV2.h.
void HTColV2::begin | ( | ) |
Initialize the color sensor.
Definition at line 18 of file MiniR4_HTColV2.cpp.
uint8_t HTColV2::getB | ( | ) |
Get the blue component value.
Definition at line 101 of file MiniR4_HTColV2.cpp.
uint8_t HTColV2::getColorNumber | ( | ) |
Get the color number detected by the sensor.
Definition at line 83 of file MiniR4_HTColV2.cpp.
uint8_t HTColV2::getG | ( | ) |
Get the green component value.
Definition at line 95 of file MiniR4_HTColV2.cpp.
float HTColV2::getH | ( | ) |
Get the hue value (H in HSV)
Definition at line 115 of file MiniR4_HTColV2.cpp.
void HTColV2::getHSV | ( | float & | h, |
float & | s, | ||
float & | v ) |
Get all HSV values at once.
h | Reference to store hue value |
s | Reference to store saturation value |
v | Reference to store brightness value |
Definition at line 136 of file MiniR4_HTColV2.cpp.
uint8_t HTColV2::getR | ( | ) |
Get the red component value.
Definition at line 89 of file MiniR4_HTColV2.cpp.
void HTColV2::getRGB | ( | uint8_t & | r, |
uint8_t & | g, | ||
uint8_t & | b ) |
Get all RGB values at once.
r | Reference to store red value |
g | Reference to store green value |
b | Reference to store blue value |
Definition at line 107 of file MiniR4_HTColV2.cpp.
float HTColV2::getS | ( | ) |
Get the saturation value (S in HSV)
Definition at line 122 of file MiniR4_HTColV2.cpp.
float HTColV2::getV | ( | ) |
Get the brightness/value (V in HSV)
Definition at line 129 of file MiniR4_HTColV2.cpp.
void HTColV2::setMode | ( | uint8_t | mode = HTCOLV2_MODE_RGB | ) |
Set the sensor mode.
mode | Sensor mode (RGB=0, PASSIVE=1, RAW=3) |
Definition at line 25 of file MiniR4_HTColV2.cpp.
uint8_t HTColV2::_ch = 0 |
I2C multiplexer channel.
Definition at line 56 of file MiniR4_HTColV2.h.
TwoWire* HTColV2::_pWire |
Pointer to Wire object.
Definition at line 57 of file MiniR4_HTColV2.h.