// switchleds.c -- copies input from switches on PORTD to LEDs on PORTB // implemented and tested on STK500 with AT90S8515 in rightmost socket // Copyleft (!C) 2003 S. Mann and C. Manders, // (http://www.gnu.org/copyleft/gpl.html); // based on Stephen Lacy's "mirror.c" //#include #include #include int main(void) { //wdt_disable(); outp (0xFF,DDRB); /* PORTB 0 means input; 1 means output */ outp (0x00,DDRD); /* PORTD */ outp(0,PORTB); while (1) { uchar x; x = inp(PIND); outb(x, PORTB); } }