Advertisement
Guest User

C led blink

a guest
Dec 26th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.21 KB | None | 0 0
  1. #include <avr/io.h>
  2. #include <util/delay.h>
  3.  
  4.  
  5. int main(void)
  6. {
  7.     DDRB = (1 << DDB5);
  8.     while(1)
  9.     {
  10.         // LED on
  11.         PORTB = (1 << DDB5);
  12.         _delay_ms(1000);
  13.         // LED off
  14.         PORTB = 0;
  15.         _delay_ms(1000);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement