API for Grove LED Bars base on the MY9221.
More...
This is a 10-segment LED bar, with 8 green segments, 1 yellow segment, and one red segment. They can be daisy chained together so that this module can control multiple LED bars.
while (shouldRun)
{
for (int i=0; i<=10; i++)
{
usleep(100000);
}
sleep(1);
for (int i=0; i<=10; i++)
{
usleep(100000);
}
sleep(1);
}
|
static const int | LEDS_PER_INSTANCE = 12 |
|
virtual void | lockData () |
|
virtual void | send16bitBlock (uint16_t data) |
|
bool | m_autoRefresh |
|
uint16_t | m_lowIntensity |
|
uint16_t | m_highIntensity |
|
unsigned int | m_instances |
|
uint16_t * | m_bitStates |
|
uint16_t | m_commandWord |
|
mraa::Gpio | m_gpioClk |
|
mraa::Gpio | m_gpioData |
|
GroveLEDBar |
( |
uint8_t |
dataPin, |
|
|
uint8_t |
clockPin, |
|
|
int |
instances = 1 |
|
) |
| |
Instantiates an GroveLEDBar object
- Parameters
-
dataPin | Data pin |
clockPin | Clock pin |
instances | Number of daisy-chained Grove LED Bars, default 1 |
void setBarLevel |
( |
uint8_t |
level, |
|
|
bool |
greenToRed = true , |
|
|
int |
barNumber = 0 |
|
) |
| |
Sets the bar level
- Parameters
-
level | Selected level for the bar (0 - 10). 0 is off |
greenToRed | true if you start the level on the first green LED, false otherwise |
barNumber | If you have multiple LED bars chained together, this argument selects a specific bar starting at 0. The default is 0. |
The documentation for this class was generated from the following files:
- /iotdk/jenkins/workspace/upm-doc-stable/src/my9221/groveledbar.h
- /iotdk/jenkins/workspace/upm-doc-stable/src/my9221/groveledbar.cxx