pentabug/firmware/apps/blinker.c

29 lines
371 B
C
Raw Normal View History

2013-08-26 01:08:00 +02:00
#include <stdlib.h>
#include <pentabug/app.h>
#include <pentabug/hal.h>
2013-08-26 01:08:00 +02:00
static void init(void) {
led_on(RIGHT);
2013-08-26 01:08:00 +02:00
}
static void blinker(void) {
led_inv(RIGHT);
led_inv(LEFT);
2013-09-03 22:49:52 +02:00
uint8_t i;
for(i = 0; i < 50; ++i) {
if(button_clicked(RIGHT)) {
motor_on();
}
if(button_clicked(LEFT)) {
motor_off();
}
wait_ms(10);
}
2013-08-26 01:08:00 +02:00
}
REGISTER(blinker, init, NULL);