Advertisement
milanmetal

[BLA] LED Dekoracija

Jan 13th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. // Nisam kitio jelku
  2. // https://photos.app.goo.gl/zVe2cRuC4L9VSfFG2
  3.  
  4. #include <avr/io.h>
  5. #include <util/delay.h>
  6. int main(void)
  7. {
  8.      DDRD = 0xff; //port D -> izlaz
  9.      DDRB |= 1 << 0; //PB4 -> izlaz
  10.      PORTB &= ~(1 << 1);
  11.    
  12.      while(1)
  13.      {
  14.         PORTD = 0xaa;
  15.         _delay_ms(150);
  16.        
  17.         PORTD = ~0xaa;
  18.         _delay_ms(150);
  19.  
  20.         PORTD = 0x55;
  21.         _delay_ms(300);
  22.     }
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement