synth/uart/ledctrl.c

25 lines
303 B
C
Raw Normal View History

2021-02-23 04:37:18 +00:00
#include "led.h"
#include "uart.h"
int main() {
int c;
int led = 0;
while (1) {
led_write(1 << led);
c = uart_read();
if (c == 'a') {
led++;
} else if (c == 'd') {
led--;
}
if (led == 8) {
led = 0;
} else if (led < 0) {
led = 7;
}
}
}