/* Include useful pre-defined functions */ #include // Defines pins, ports, etc to make programs easier to read #define F_CPU 1000000UL // Sets up the default speed for delay.h #include char tmp = 0; int main(){ DDRD = _BV(PD4); /* enable output on port D, pin 5 */ DDRB &= ~_BV(PB0); while(1){ char data = PINB & _BV(PB0); if(data != 0) { _delay_ms(10); data = PINB & _BV(PB0); if(data != 0) PORTD &= ~_BV(PD4); } else { PORTD = _BV(PD4); } } return(0); }