Cubelets API Documentation 2.0
C API
Loading...
Searching...
No Matches
mood_ring.h File Reference

See Mood Ring Pachinko Example

Go to the source code of this file.

Functions

void LedSetAll (uint8_t r, uint8_t g, uint8_t b)
 Set all LEDs to the specified RGB values.
 
void LedSet (uint8_t led, uint8_t r, uint8_t g, uint8_t b)
 Set the specified LED to the given RGB values.
 
void LedSetHue (uint8_t led, uint8_t hue, uint8_t level)
 Set the specified LED to the given hue and light level.
 
void LedGet (uint8_t led, uint8_t *r, uint8_t *g, uint8_t *b)
 Get the current RGB values of the specified LED.
 
void hueToRGB (uint8_t hue, uint8_t light, uint8_t *r, uint8_t *g, uint8_t *b)
 Convert a hue and light level to RGB values.
 
void shiftLEDCircleRight (uint8_t places)
 Shift the LEDs in the circle to the right by a specified number of places.
 
void shiftLEDCircleLeft (uint8_t places)
 Shift the LEDs in the circle to the left by a specified number of places.
 
void LedRingUpdate (void)
 Update the LED ring with the current values.
 
void AdjustBrightness (uint8_t led, float scale)
 Adjust the brightness of a specified LED by a scale factor.
 

Function Documentation

◆ LedSetAll()

void LedSetAll ( uint8_t r,
uint8_t g,
uint8_t b )
Parameters
rThe red color value.
gThe green color value.
bThe blue color value.

◆ LedSet()

void LedSet ( uint8_t led,
uint8_t r,
uint8_t g,
uint8_t b )
Parameters
ledThe LED index.
rThe red color value.
gThe green color value.
bThe blue color value.

◆ LedSetHue()

void LedSetHue ( uint8_t led,
uint8_t hue,
uint8_t level )
Parameters
ledThe LED index.
hueThe hue value.
levelThe light level.

◆ LedGet()

void LedGet ( uint8_t led,
uint8_t * r,
uint8_t * g,
uint8_t * b )
Parameters
ledThe LED index.
rPointer to store the red color value.
gPointer to store the green color value.
bPointer to store the blue color value.

◆ hueToRGB()

void hueToRGB ( uint8_t hue,
uint8_t light,
uint8_t * r,
uint8_t * g,
uint8_t * b )
Parameters
hueThe hue value.
lightThe light value.
rPointer to store the red color value.
gPointer to store the green color value.
bPointer to store the blue color value.

◆ shiftLEDCircleRight()

void shiftLEDCircleRight ( uint8_t places)
Parameters
placesThe number of places to shift.

◆ shiftLEDCircleLeft()

void shiftLEDCircleLeft ( uint8_t places)
Parameters
placesThe number of places to shift.

◆ LedRingUpdate()

void LedRingUpdate ( void )

This function must be called for the changes to be made effective.

◆ AdjustBrightness()

void AdjustBrightness ( uint8_t led,
float scale )
Parameters
ledThe LED index.
scaleThe scale factor for brightness.