pentabug/firmware/apps/buggy.c

27 lines
409 B
C
Raw Normal View History

#include <stdlib.h>
#include <pentabug/app.h>
#include <pentabug/hal.h>
#include <pentabug/photons.h>
#include <pentabug/pentatonic.h>
static void init(void) {
pentatonic_direction(ALL_OUT);
photons_init();
2013-09-03 21:25:07 +02:00
led_on(RIGHT);
}
static void run(void) {
2013-09-03 21:25:07 +02:00
uint8_t light = photons_measure();
2013-09-03 20:14:30 +02:00
pentatonic_all_led_set(light >> 3);
2013-09-03 21:25:07 +02:00
led_inv(LEFT);
led_inv(RIGHT);
wait_ms(100);
}
REGISTER(run, init, NULL);