Advertisement
anticlown

Blink firmware(Arduino Nano)

Oct 31st, 2023
976
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 1 0
  1. #include <mega328p.h>
  2. #include <delay.h>
  3.  
  4. void main(void) {
  5.     int i = 0;
  6.     while(1){                                                                                              
  7.         i = i ^ 1;
  8.         delay_ms(200);
  9.         PORTB = (i<<PORTB7)|(i<<PORTB6)|(i<<PORTB5)|(i<<PORTB4)|(i<<PORTB3)|(i<<PORTB2)|(i<<PORTB1)|(i<<PORTB0);
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement