Add motor stuff to blinker

This commit is contained in:
Thammi 2013-09-03 22:49:52 +02:00
parent c7433474af
commit 5b81a6daf7
2 changed files with 14 additions and 1 deletions

View File

@ -10,7 +10,19 @@ static void init(void) {
static void blinker(void) {
led_inv(RIGHT);
led_inv(LEFT);
wait_ms(500);
uint8_t i;
for(i = 0; i < 50; ++i) {
if(button_clicked(RIGHT)) {
motor_on();
}
if(button_clicked(LEFT)) {
motor_off();
}
wait_ms(10);
}
}
REGISTER(blinker, init, NULL);

View File

@ -4,6 +4,7 @@
#include <pentabug/hal.h>
#include <pentabug/photons.h>
#include <pentabug/pentatonic.h>
#include <pentabug/music.h>
inline uint16_t biased_random(uint8_t value) {
return value / 4 * (rand() & 7);