Add motor stuff to blinker
This commit is contained in:
parent
c7433474af
commit
5b81a6daf7
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user