Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include <avr/io.h>
  2. #define F_CPU 14.7456E6
  3. #include <util/delay.h>
  4.  
  5. int main(void)
  6. {
  7. DDRB = 0xFF;
  8. PORTB = 0x00;
  9. DDRD = 0x00;
  10. PORTD = 0xFF;
  11. while(1)
  12. {
  13. if ((~PIND & (1<<PD0)))
  14. {
  15. PORTB = 0xFF;
  16. }
  17. else if ((~PIND & (1<<PD1)))
  18. {
  19. PORTB = 0x00;
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement