From a27dd519123dc0d1bca0df08de35821418a912c9 Mon Sep 17 00:00:00 2001 From: Thammi Date: Fri, 6 Sep 2013 13:53:19 +0200 Subject: [PATCH] Better buggy behaviour --- firmware/apps/buggy.c | 10 +++++----- firmware/lib/photons.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/firmware/apps/buggy.c b/firmware/apps/buggy.c index e38b200..008d2b4 100644 --- a/firmware/apps/buggy.c +++ b/firmware/apps/buggy.c @@ -8,7 +8,7 @@ #include inline uint16_t biased_random(uint8_t value) { - return value / 4 * (rand() & 7); + return value / 2 * (rand() & 15); } static void init(void) { @@ -79,12 +79,12 @@ static void run(void) { pentatonic_all_led_set(light >> 3); - motor_set(biased_random(light) > 0x40); + motor_set(biased_random(light) > 0x70); - led_set(RIGHT, biased_random(light) > 0x20); - led_set(LEFT, biased_random(light) > 0x20); + led_set(RIGHT, biased_random(light) > 0x30); + led_set(LEFT, biased_random(light) > 0x30); - if(biased_random(light) > 0x50) { + if(biased_random(light) > 0x60) { uint16_t tone = (biased_random(light) * 2) + 500; set_note(tone, 0); } else { diff --git a/firmware/lib/photons.c b/firmware/lib/photons.c index 5d8c506..c001415 100644 --- a/firmware/lib/photons.c +++ b/firmware/lib/photons.c @@ -39,7 +39,7 @@ uint8_t photons_measure(void) { // collect some photons - wait_ms(1); + wait_ms(10); // start measurement