#include #include "uart.h" int main(void) { /* serial */ uart_init(); /* D4 = output and high (=> atx down) */ PORTD |= 0x10; DDRD |= 0x10; for (;;) { switch(uart_getchar()) { case '?': break; /* useful for auto documentation */ case '0': PORTD |= 0x10; break; case '1': PORTD &= ~0x10; break; case 'T': PORTD ^= 0x10; break; } uart_putchar((PORTD & 0x10) ? '0' : '1'); } return 0; }