e_led.c File Reference

Manage the LEDs with blinking possibility (timer2). More...

#include "../e_epuck_ports.h"
#include "e_agenda.h"

Defines

#define LED_EFFECTS
 For the preprocessor. Comment if you want not to use the LED effects.

Functions

void e_set_led (unsigned int led_number, unsigned int value)
 turn on/off the specified LED
void e_led_clear (void)
 turn off the 8 LEDs
void e_set_body_led (unsigned int value)
 turn on/off the body LED
void e_set_front_led (unsigned int value)
 turn on/off the front LED
void e_blink_led (void)
 Change the state of all LED.
void e_blink_led0 (void)
 Change the state of LED0.
void e_blink_led1 (void)
 Change the state of LED1.
void e_blink_led2 (void)
 Change the state of LED2.
void e_blink_led3 (void)
 Change the state of LED3.
void e_blink_led4 (void)
 Change the state of LED4.
void e_blink_led5 (void)
 Change the state of LED5.
void e_blink_led6 (void)
 Change the state of LED6.
void e_blink_led7 (void)
 Change the state of LED7.
void e_start_led_blinking (int cycle)
 Start blinking all LED.
void e_stop_led_blinking (void)
 Stop blinking all LED.
void e_set_blinking_cycle (int cycle)
 Change the blinking speed.
void snake_led (void)
 One led is on and turn clockwise.
void flow_led (void)
 The leds go on from the front to the back and go off from the front to the back, etc.
void k2000_led (void)
 The K2000 effect.
void right_led (void)
 The right LED are indicating the right side.
void left_led (void)
 The left LED are indicating the left side.


Detailed Description

Manage the LEDs with blinking possibility (timer2).

Here we use the agenda solution to make the LED blinking.

A little exemple for LEDs blinking with agenda (all LEDs blink with 100ms delay)

Warning:
this program uses the e_blink_led(void) function.
 #include <p30f6014A.h>
 #include <motor_led/e_epuck_ports.h>
 #include <motor_led/e_init_port.h>
 #include <motor_led/advance_one_timer/e_led.h>
 #include <motor_led/advance_one_timer/e_agenda.h>
 
 int main(void)
 {
        e_init_port();
        e_activate_agenda(e_blink_led, 1000); //blink with 100ms
        e_start_agendas_processing();
        while(1) {}
 }
See also:
e_agenda.h
Author:
Code: Francesco Mondada, Lucas Meier, Jonathan Besuchet
Doc: Jonathan Besuchet

Define Documentation

#define LED_EFFECTS

For the preprocessor. Comment if you want not to use the LED effects.


Function Documentation

void e_blink_led ( void   ) 

Change the state of all LED.

Callback function for an agenda.

See also:
AgendaType

void e_blink_led0 ( void   ) 

Change the state of LED0.

Callback function for an agenda.

See also:
AgendaType

void e_blink_led1 ( void   ) 

Change the state of LED1.

Callback function for an agenda.

See also:
AgendaType

void e_blink_led2 ( void   ) 

Change the state of LED2.

Callback function for an agenda.

See also:
AgendaType

void e_blink_led3 ( void   ) 

Change the state of LED3.

Callback function for an agenda.

See also:
AgendaType

void e_blink_led4 ( void   ) 

Change the state of LED4.

Callback function for an agenda.

See also:
AgendaType

void e_blink_led5 ( void   ) 

Change the state of LED5.

Callback function for an agenda.

See also:
AgendaType

void e_blink_led6 ( void   ) 

Change the state of LED6.

Callback function for an agenda.

See also:
AgendaType

void e_blink_led7 ( void   ) 

Change the state of LED7.

Callback function for an agenda.

See also:
AgendaType

void e_led_clear ( void   ) 

turn off the 8 LEDs

The e-puck has 8 green LEDs. This function turn all off.

Warning:
this function doesn't turn off "body LED" and "front LED".

void e_set_blinking_cycle ( int  cycle  ) 

Change the blinking speed.

This function use e_set_agenda_cycle(void (*func)(void), int cycle)

Parameters:
cycle the number of cycle we wait before launching e_blink_led(void)"
See also:
e_blink_led, e_set_agenda_cycle

void e_set_body_led ( unsigned int  value  ) 

turn on/off the body LED

The e-puck has a green LED that illuminate his body. With this function, you can change the state of these LED.

Parameters:
value 0 (off), 1 (on) otherwise change the state

void e_set_front_led ( unsigned int  value  ) 

turn on/off the front LED

The e-puck has a red LED in the front. With this function, you can change the state of these LED.

Parameters:
value 0 (off), 1 (on) otherwise change the state

void e_set_led ( unsigned int  led_number,
unsigned int  value 
)

turn on/off the specified LED

The e-puck has 8 green LEDs. With this function, you can change the state of these LEDs.

Parameters:
led_number between 0 and 7
value 0 (off), 1 (on) otherwise change the state
Warning:
if led_number is other than 0-7, all leds are set to the indicated value.

void e_start_led_blinking ( int  cycle  ) 

Start blinking all LED.

Parameters:
cycle the number of cycle we wait before launching e_blink_led(void)
See also:
e_blink_led, e_activate_agenda

void e_stop_led_blinking ( void   ) 

Stop blinking all LED.

This function use e_destroy_agenda(void (*func)(void))

See also:
e_destroy_agenda

void flow_led ( void   ) 

The leds go on from the front to the back and go off from the front to the back, etc.

void k2000_led ( void   ) 

The K2000 effect.

void left_led ( void   ) 

The left LED are indicating the left side.

void right_led ( void   ) 

The right LED are indicating the right side.

void snake_led ( void   ) 

One led is on and turn clockwise.


Generated on Fri Feb 29 14:26:54 2008 for e-puck by  doxygen 1.5.4