Elisa3
leds.h File Reference

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.

Detailed Description

Leds module.

Author:
Stefano Morgani <stefano@gctronic.com>
Version:
1.0
Date:
01.02.12

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.


Function Documentation

void initRGBleds ( )

Configure the timer1/pwm registers to work at about 30 KHz.

Returns:
none
void setGreenLed ( unsigned char  ledNum,
unsigned char  isOn 
)

Set small green led state (on, off).

Returns:
none
void toggleBlueLed ( )

Toggle the state of the blue led.

Returns:
none
void turnOffGreenLeds ( )

Turn off all small green leds around the robot.

Returns:
none
void turnOnGreenLeds ( )

Turn on all small green leds around the robot.

Returns:
none
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.

Parameters:
valueled luminosity (duty cycle); from 0 (max power on) to 255 (off)
Returns:
none
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.

Parameters:
valueled luminosity (duty cycle); from 0 (max power on) to 255 (off)
Returns:
none
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.

Parameters:
valueled luminosity (duty cycle); from 0 (max power on) to 255 (off)
Returns:
none
 All Files Functions Variables Defines