upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
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.
Public Member Functions | |
GroveLEDBar (int dataPin, int clockPin, int instances=1) | |
virtual | ~GroveLEDBar () |
void | setBarLevel (uint8_t level, bool greenToRed=true, unsigned int barNumber=0) |
Public Member Functions inherited from MY9221 | |
MY9221 (int dataPin, int clockPin, int instances=1) | |
virtual | ~MY9221 () |
void | setAutoRefresh (bool enable) |
void | setLED (int led, bool on) |
void | setLowIntensityValue (int intensity) |
void | setHighIntensityValue (int intensity) |
void | setAll () |
void | clearAll () |
void | refresh () |
Additional Inherited Members | |
Protected Attributes inherited from MY9221 | |
my9221_context | m_my9221 |
GroveLEDBar | ( | int | dataPin, |
int | clockPin, | ||
int | instances = 1 |
||
) |
Instantiates an GroveLEDBar object
dataPin | Data pin |
clockPin | Clock pin |
instances | Number of daisy-chained Grove LED Bars, default 1 |
|
virtual |
GroveLEDBar destructor
void setBarLevel | ( | uint8_t | level, |
bool | greenToRed = true , |
||
unsigned int | barNumber = 0 |
||
) |
Sets the bar level
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. |