|
| Mrm_col (HardwareSerial *hardwareSerial=0) |
|
void | add (byte address=0x49, uint8_t integrationTime=50, uint8_t dataConversionType=2, uint8_t gain=3) |
|
uint16_t | blue (uint8_t sensorNumber) |
|
float | blueCalibrated (uint8_t sensorNumber) |
|
void | dataConversionTypeSet (uint8_t sensorNumber, uint8_t mode) |
|
boolean | dataReadyGet (uint8_t sensorNumber) |
|
void | dataReadyClear (uint8_t sensorNumber) |
|
void | gainSet (uint8_t sensorNumber, uint8_t gain) |
|
uint16_t | green (uint8_t sensorNumber) |
|
float | greenCalibrated (uint8_t sensorNumber) |
|
void | integrationTimeSet (uint8_t sensorNumber, uint8_t integrationValue) |
|
void | interruptSet (uint8_t sensorNumber, bool enabled) |
|
void | ledForIlluminationCurrentSet (uint8_t sensorNumber, uint8_t current) |
|
void | ledForIlluminationSet (uint8_t sensorNumber, bool enabled) |
|
void | ledIndicatorCurrentSet (uint8_t sensorNumber, uint8_t current) |
|
void | ledIndicatorSet (uint8_t sensorNumber, bool enabled) |
|
uint16_t | orange (uint8_t sensorNumber) |
|
float | orangeCalibrated (uint8_t sensorNumber) |
|
uint16_t | red (uint8_t sensorNumber) |
|
float | redCalibrated (uint8_t sensorNumber) |
|
void | reset (uint8_t sensorNumber) |
|
uint8_t | temperature (uint8_t sensorNumber) |
|
void | test (BreakCondition breakWhen=0) |
|
uint16_t | violet (uint8_t sensorNumber) |
|
float | violetCalibrated (uint8_t sensorNumber) |
|
uint16_t | yellow (uint8_t sensorNumber) |
|
float | yellowCalibrated (uint8_t sensorNumber) |
|
◆ Mrm_col()
Mrm_col::Mrm_col |
( |
HardwareSerial * |
hardwareSerial = 0 | ) |
|
Constructor
- Parameters
-
hardwareSerial | - Serial, Serial1, Serial2,... - an optional serial port, for example for Bluetooth communication. Example: Mrm_col(&Serial2); |
◆ add()
void Mrm_col::add |
( |
byte |
address = 0x49 , |
|
|
uint8_t |
integrationTime = 50 , |
|
|
uint8_t |
dataConversionType = 2 , |
|
|
uint8_t |
gain = 3 |
|
) |
| |
Add a sensor
- Parameters
-
i2cBus | - I2C bus 0 is Wire, 1 is Wire1, etc. For example, command for Wire1 is: add(&Wire1); |
address | - I2C adress |
integrationTime | |
dataConversionType | |
gain | Add a sensor |
i2cBus | - I2C bus 0 is Wire, 1 is Wire1, etc. For example, command for Wire1 is: add(&Wire1); |
address | - I2C adress |
◆ blue()
Blue
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
- Returns
- - blue
◆ blueCalibrated()
float Mrm_col::blueCalibrated |
( |
uint8_t |
sensorNumber | ) |
|
Calibrated blue
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
- Returns
- - calibrated blue
◆ dataConversionTypeSet()
void Mrm_col::dataConversionTypeSet |
( |
uint8_t |
sensorNumber, |
|
|
uint8_t |
conversionType |
|
) |
| |
Sets data conversion type
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
conversionType | 0, continuous reading of violet, blue, green and yellow 1, continuous reading of green, yellow, orange and red 2, continuous reading of all channels (power-on default) 3, one-time reading of all channels |
Sets data conversion type
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
conversionType | 0, continuous reading of violet, blue, green and yellow 1, continuous reading of green, yellow, orange and red 2, continuous reading of all channels (power-on default but requires 2 x integration time, double compared to types 0 or 1) 3, one-time reading of all channels |
◆ dataReadyClear()
void Mrm_col::dataReadyClear |
( |
uint8_t |
sensorNumber | ) |
|
Clear data-ready flag
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
◆ dataReadyGet()
boolean Mrm_col::dataReadyGet |
( |
uint8_t |
sensorNumber | ) |
|
Data ready?
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
- Returns
- - ready or not
◆ gainSet()
Set gain
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
gain | 0, 1x (default) 1, 3.7x 2, 16x 3, 64x |
◆ green()
Green
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
- Returns
- - green
◆ greenCalibrated()
float Mrm_col::greenCalibrated |
( |
uint8_t |
sensorNumber | ) |
|
Calibrated green
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
- Returns
- - calibrated green
◆ integrationTimeSet()
void Mrm_col::integrationTimeSet |
( |
uint8_t |
sensorNumber, |
|
|
uint8_t |
value |
|
) |
| |
Set integration time
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
value | - integration time will be value x 2.8 ms. value is between 0 and 255 (default). |
◆ interruptSet()
void Mrm_col::interruptSet |
( |
uint8_t |
sensorNumber, |
|
|
bool |
enabled |
|
) |
| |
Enable/disable interrupt pin's output
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
enabled | - true (enabled) or false (disabled, default value) |
◆ ledForIlluminationCurrentSet()
void Mrm_col::ledForIlluminationCurrentSet |
( |
uint8_t |
sensorNumber, |
|
|
uint8_t |
current |
|
) |
| |
LED for illumination, set current
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
current | 0, 12.5 mA (default) 1, 25 mA 2, 50 mA 3, 100 mA |
◆ ledForIlluminationSet()
void Mrm_col::ledForIlluminationSet |
( |
uint8_t |
sensorNumber, |
|
|
bool |
enabled |
|
) |
| |
LED for illumination on-off
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
enabled | - true (enabled) or false (disabled, default) |
◆ ledIndicatorCurrentSet()
void Mrm_col::ledIndicatorCurrentSet |
( |
uint8_t |
sensorNumber, |
|
|
uint8_t |
current |
|
) |
| |
LED indicator's current
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
current | 0, 1 mA (default) 1, 2 mA 2, 4 mA 3, 8 mA |
◆ ledIndicatorSet()
void Mrm_col::ledIndicatorSet |
( |
uint8_t |
sensorNumber, |
|
|
bool |
enabled |
|
) |
| |
LED indicator on-off
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
enabled | - true (enabled) or false (disabled, default) |
◆ orange()
Orange
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
- Returns
- - orange
◆ orangeCalibrated()
float Mrm_col::orangeCalibrated |
( |
uint8_t |
sensorNumber | ) |
|
Calibrated orange
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
- Returns
- - calibrated orange
◆ red()
Red
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
- Returns
- - red
◆ redCalibrated()
float Mrm_col::redCalibrated |
( |
uint8_t |
sensorNumber | ) |
|
Calibrated red
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
- Returns
- - calibrated red
◆ reset()
void Mrm_col::reset |
( |
uint8_t |
sensorNumber | ) |
|
Reset
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
◆ temperature()
Temperature in C
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
- Returns
- - temperature
◆ test()
void Mrm_col::test |
( |
BreakCondition |
breakWhen = 0 | ) |
|
Test
- Parameters
-
breakWhen | - A function returning bool, without arguments. If it returns true, the test() will be interrupted. |
◆ violet()
Violet
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
- Returns
- - violet
◆ violetCalibrated()
float Mrm_col::violetCalibrated |
( |
uint8_t |
sensorNumber | ) |
|
Calibrated violet
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
- Returns
- - calibrated violet
◆ yellow()
Yellow
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
- Returns
- - yellow
◆ yellowCalibrated()
float Mrm_col::yellowCalibrated |
( |
uint8_t |
sensorNumber | ) |
|
Calibrated yellow
- Parameters
-
sensorNumber | - Sensor's ordinal number. Each call of function add() assigns a increasing number to the sensor, starting with 0. |
- Returns
- - calibrated yellow
The documentation for this class was generated from the following files:
- C:/Users/priba/Documents/PlatformIO/Projects/MRMS/lib/mrm-col/src/mrm-col.h
- C:/Users/priba/Documents/PlatformIO/Projects/MRMS/lib/mrm-col/src/mrm-col.cpp