![]() |
roneos
Operating System for the r-one robot
|
Interface function for LEDs on the robot. More...
Go to the source code of this file.
Functions | |
void | ledsInit (void) |
Initializes the LEDs. More... | |
void | ledsSetSingle (uint32 led_idx, uint32 dimmer) |
Sets the brightness of a specified dimmer. More... | |
void | ledSetGroup (uint32 led_color, uint32 dimmer) |
Sets the brightness of all dimmers of a specified color. More... | |
void | ledsSetBinary (uint8 r, uint8 g, uint8 b) |
Turns LEDS on or off depending on the input values for each grouping. More... | |
void | ledsSetAll (uint32 dimmer) |
Sets the brightness of all dimmers on the robot. More... | |
void | ledsSetPattern (uint8 color, uint8 pattern, uint8 brightness, uint8 rate) |
Sets the properties of the LED animation if remote control mode is off. More... | |
uint8 | ledStartIdx (uint8 color) |
Gets the start index of the LEDs for the input color group. More... | |
void | ledsUpdate (void) |
Updates LED animation. More... | |
void | ledsBuildMessage (uint8 *msg) |
Build LED message. More... | |
Interface function for LEDs on the robot.
void ledsBuildMessage | ( | uint8 * | msg) |
Build LED message.
Blue, green, red.
msg | pointer for the message |
void ledSetGroup | ( | uint32 | led_color, |
uint32 | dimmer | ||
) |
Sets the brightness of all dimmers of a specified color.
If the specified color does not match the existing colors, does nothing.
led_color | specifies the dimmer color to be set |
dimmer | brightness to be set |
void ledsInit | ( | void | ) |
Initializes the LEDs.
Configure the LED_MODE pin as output. Turns off all dimmer. Latches dimmer data. Latches on/off data with a mask (FFFF). Sets the LED properties - color red, pattern circle, brightness high, and rate fast.
void ledsSetAll | ( | uint32 | dimmer) |
Sets the brightness of all dimmers on the robot.
dimmer | the brightness to be set |
void ledsSetBinary | ( | uint8 | r, |
uint8 | g, | ||
uint8 | b | ||
) |
Turns LEDS on or off depending on the input values for each grouping.
For example, a 1 for the red leds indicates the first led will be on. A 3 for the blue leds will turn on the second led. A 5 for the green will turn on the first and third leds.
r | binary pattern for red leds |
g | binary pattern for green leds |
b | binary pattern for blue leds |
void ledsSetPattern | ( | uint8 | color, |
uint8 | pattern, | ||
uint8 | brightness, | ||
uint8 | rate | ||
) |
Sets the properties of the LED animation if remote control mode is off.
Sets the color, patter, brightness, and rate of the LED animation.
color | which color group to set |
pattern | lights can run in patterns such as circle/all/etc. |
brightness | the brightness to set the pattern |
rate | the speed at which the pattern cycles |
void ledsSetSingle | ( | uint32 | led_idx, |
uint32 | dimmer | ||
) |
Sets the brightness of a specified dimmer.
If the index exceeds the number of elements in the LED (16), does nothing. If the value exceeds the maximum brightness(7F), uses the maximum as the value instead.
led_idx | indicates which dimmer's brightness is to be set |
dimmer | brightness to be set |
uint8 ledStartIdx | ( | uint8 | color) |
Gets the start index of the LEDs for the input color group.
Default will return the red LED start index
color | to find the start index of |
void ledsUpdate | ( | void | ) |
Updates LED animation.
Updates LED animation according to the color, pattern, brightness, and rate previously set. Sets properties using the ledsSetPattern function.