upm  1.3.0
Sensor/Actuator repository for libmraa (v1.7.0)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions
GroveCircularLED Class Reference

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.

// Instantiate a Grove Circular LED on D9 for data, D8 for clock
int level = 0;
while (shouldRun)
level = (level + 1) % 24;

Public Member Functions

 GroveCircularLED (int dataPin, int clockPin)
virtual ~GroveCircularLED ()
void setSpinner (uint8_t position)
void setLevel (uint8_t level, bool direction=true)
- 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

Constructor & Destructor Documentation

GroveCircularLED ( int  dataPin,
int  clockPin 

Instantiates an GroveCircularLED object

dataPinData pin
clockPinClock pin

Here is the call graph for this function:

~GroveCircularLED ( )

GroveCircularLED destructor

Member Function Documentation

void setSpinner ( uint8_t  position)

Sets the spinner (turns off all LEDs but selected one)

positionSelected position for the spinner (0-23)

Here is the call graph for this function:

void setLevel ( uint8_t  level,
bool  direction = true 

Sets the lighting status

levelSelected level for the circular LED (0-23)
directionUp or down; up is true and default

Here is the call graph for this function:

Inheritance diagram for GroveCircularLED:
Inheritance graph
Collaboration diagram for GroveCircularLED:
Collaboration graph

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