Advertisement
Regeneric

Zanim kupisz Atmegę

Jul 5th, 2017
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. /*
  2.  * randomrussian.c
  3.  *
  4.  * Created: 05.07.2017 17:50:26
  5.  * Author : hkk
  6.  */
  7.  
  8. #include <avr/io.h>
  9.  
  10. #define LED (1<<PB5)
  11. #define INP (1<<PD0)
  12.  
  13. int main(void) {
  14.    
  15.     DDRB |= LED;
  16.     DDRD &= ~INP;
  17.    
  18.     while(1) {
  19.         if (PIND & INP) PORTB |= LED;
  20.         else PORTB &= ~LED;
  21.     }
  22. }
  23.  
  24. /* http://russianrandom.blox.pl/html */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement