Manage the LEDs with blinking possibility (timer2).
Manage the IR receiver module (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)
#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);
e_start_agendas_processing();
while(1) {}
}
- See also:
- e_agenda.h
- Author:
- Code: Valentin Longchamp
Doc: Jonathan Besuchet
This module manage the IR receiver with the agenda solution (timer2).
A little exemple to manage the IR remote (the body LED change his state when you press a button of the IR controller).
#include <p30f6014A.h>
#include <motor_led/e_epuck_ports.h>
#include <motor_led/e_init_port.h>
#include <motor_led/advance_one_timer/e_remote_control.h>
#include <motor_led/advance_one_timer/e_agenda.h>
int main(void)
{
int ir_check;
int previous_check = 0;
e_init_port();
e_init_remote_control();
e_start_agendas_processing();
while(1)
{
ir_check = e_get_check();
if(ir_check != previous_check)
BODY_LED = BODY_LED^1;
previous_check = ir_check;
}
}
- See also:
- e_agenda.h
- Author:
- Jonathan Besuchet