e_led.c File Reference

Manage the LEDs.
A little exemple for the LEDs (all the LEDs are blinking). More...

#include "e_epuck_ports.h"
#include "e_led.h"

Functions

void e_set_led (unsigned int led_number, unsigned int value)
 turn on/off the specified LED
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_led_clear (void)
 turn off the 8 LEDs


Detailed Description

Manage the LEDs.
A little exemple for the LEDs (all the LEDs are blinking).

 #include <p30f6014A.h>
 #include <motor_led/e_epuck_ports.h>
 #include <motor_led/e_init_port.h>
 #include <motor_led/e_led.h>
 
 int main(void)
 {
        e_init_port();
        while(1)
        {
                long i;
                for(i=0; i<500000; i++)
                        asm("NOP");
                e_set_led(8, 2); //switch the state of all leds
        }
 }
Author:
Code: Michael Bonani, Francesco Mondada, Davis Dadie
Doc: Jonathan Besuchet

Function Documentation

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_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 this 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 this 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.


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