- Main Page
- Modules
- Data Structures
- Files
- Directories

# e_led.c File Reference

Manage the LEDs with blinking possibility (timer1, 2, 3). More...

`#include "../../e_epuck_ports.h"`
`#include "e_agenda_fast.h"`

## 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.

## Detailed Description

Manage the LEDs with blinking possibility (timer1, 2, 3).

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

See also:
  e_agenda.h

Author:
  Code: Francesco Mondada
  Doc: Jonathan Besuchet

## 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()"

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()"

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