document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. //include libraries
  2. #include <avr/io.h>
  3. #include <util/delay.h>
  4.  
  5.  
  6. int main (void) {
  7.  
  8. DDRA &= ~(1 << PA7);
  9. PORTA |= (1 << PA7);
  10. DDRB |= (1 << PB2);
  11. PORTB &= ~(1 << PB2);
  12.  
  13.  
  14. while (1){
  15. if
  16. ((PINA & (1 << PA7)) == 0){
  17. PORTB |= (1 << PB2);
  18. _delay_ms(1000);
  19. PORTB &= ~(1 << PB2);
  20. _delay_ms(3000);
  21. }
  22.  
  23. else {
  24. PORTB |= (1 << PB2);
  25. }
  26. }
  27. }
');