upm  0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
Public Member Functions

API for the Grove Circular LED module. More...

Detailed Description

This is a circular LED ring based on the MY9221 chip. It is often used with a rotary encoder and has 24 controllable LEDs.

grovecircularled.jpg
// Instantiate a Grove Circular LED on gpio pins 5 and 4
int level = 0;
while (shouldRun)
{
circle->setSpinner(level);
level = (level + 1) % 24;
usleep(100000);
}

Public Member Functions

 GroveCircularLED (uint8_t di, uint8_t dcki)
 
mraa::Result setLevel (uint8_t level, bool direction=true)
 
mraa::Result setSpinner (uint8_t position)
 
mraa::Result setStatus (bool status[24])
 
std::string name ()
 

Constructor & Destructor Documentation

GroveCircularLED ( uint8_t  di,
uint8_t  dcki 
)

Instantiates an MY9221 object

Parameters
diData pin
dckiClock pin

Member Function Documentation

mraa::Result setLevel ( uint8_t  level,
bool  direction = true 
)

Sets the lighting status

Parameters
levelSelected level for the circular LED (0-24)
directionUp or down; up is true and default
mraa::Result setSpinner ( uint8_t  position)

Sets the spinner (lights up all the other LEDs but one)

Parameters
positionSelected position for the spinner (0-23)
mraa::Result setStatus ( bool  status[24])

Sets the lighting status

Parameters
statusBoolean array (24 elements)
std::string name ( )
inline

Returns the name of the component


The documentation for this class was generated from the following files: