2013-08-31 22:26:26 +02:00
|
|
|
#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);
|
2013-08-31 22:26:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void run(void) {
|
2013-09-03 21:25:07 +02:00
|
|
|
uint8_t light = photons_measure();
|
2013-08-31 22:26:26 +02:00
|
|
|
|
2013-09-03 20:14:30 +02:00
|
|
|
pentatonic_all_led_set(light >> 3);
|
2013-08-31 22:26:26 +02:00
|
|
|
|
2013-09-03 21:25:07 +02:00
|
|
|
led_inv(LEFT);
|
|
|
|
led_inv(RIGHT);
|
|
|
|
|
|
|
|
wait_ms(100);
|
2013-08-31 22:26:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
REGISTER(run, init, NULL);
|