Advertisement
elektronek

Atmega328 blink :-)

Oct 3rd, 2019
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.25 KB | None | 0 0
  1. #define F_CPU 16000000ul
  2. #include <util/delay.h>
  3. #define LED PB5
  4. #define LED_ON  PORTB |= (1<<LED)
  5. #define LED_OFF PORTB &= ~(1<<LED)
  6. #define LED_TGL PINB |= (1<<LED)
  7.  
  8. int main()
  9. {
  10.     DDRB |= (1<<LED);
  11.     while(1)
  12.     {
  13.         LED_TGL;
  14.         _delay_ms(500);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement