Elisa3
|
Leds module. More...
#include "variables.h"
Go to the source code of this file.
Functions | |
void | initRGBleds () |
Configure the timer1/pwm registers to work at about 30 KHz. | |
void | toggleBlueLed () |
Toggle the state of the blue led. | |
void | updateRedLed (unsigned char value) |
Update the value of the red led accordingly to the received argument. The function is used every time a radio/tv remote command is received. | |
void | updateGreenLed (unsigned char value) |
Update the value of the green led accordingly to the received argument. The function is used every time a radio/tv remote command is received. | |
void | updateBlueLed (unsigned char value) |
Update the value of the blue led accordingly to the received argument. The function is used every time a radio/tv remote command is received. | |
void | setGreenLed (unsigned char ledNum, unsigned char isOn) |
Set small green led state (on, off). | |
void | turnOffGreenLeds () |
Turn off all small green leds around the robot. | |
void | turnOnGreenLeds () |
Turn on all small green leds around the robot. |
Leds module.
The RGB leds are handled with the timer1 that can manage three different pwm, one used for each color. The frequency for the three pwm remains the same, but the duty cycle (led luminosity) can be changed independently from each other, letting creating a wide range of different colors. Moreover the module contains functions for handling the small green leds placed around the robot.
void initRGBleds | ( | ) |
Configure the timer1/pwm registers to work at about 30 KHz.
void setGreenLed | ( | unsigned char | ledNum, |
unsigned char | isOn | ||
) |
Set small green led state (on, off).
void toggleBlueLed | ( | ) |
Toggle the state of the blue led.
void turnOffGreenLeds | ( | ) |
Turn off all small green leds around the robot.
void turnOnGreenLeds | ( | ) |
Turn on all small green leds around the robot.
void updateBlueLed | ( | unsigned char | value | ) |
Update the value of the blue led accordingly to the received argument. The function is used every time a radio/tv remote command is received.
value | led luminosity (duty cycle); from 0 (max power on) to 255 (off) |
void updateGreenLed | ( | unsigned char | value | ) |
Update the value of the green led accordingly to the received argument. The function is used every time a radio/tv remote command is received.
value | led luminosity (duty cycle); from 0 (max power on) to 255 (off) |
void updateRedLed | ( | unsigned char | value | ) |
Update the value of the red led accordingly to the received argument. The function is used every time a radio/tv remote command is received.
value | led luminosity (duty cycle); from 0 (max power on) to 255 (off) |