Advertisement
Andrei_M

1.dsp

Oct 28th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. /*
  2.  * first.c
  3.  *
  4.  * Created: 28.10.2019 12:25:37
  5.  * Author : dspproject
  6.  */
  7. // 14.7456 MHz
  8. #define F_CPU 14745600UL
  9.  
  10. #include <avr/io.h>
  11. #include <avr/interrupt.h>
  12. #include <util/delay.h>
  13.  
  14. int main(void)
  15. {
  16.     /* Replace with your application code */
  17.     DDRB |= 0xFF;
  18.     int i;
  19.     while (1)
  20.     {
  21.    
  22.         for(i = 0; i < 7; i++)
  23.         {
  24.             PORTB = 1<<i;
  25.             _delay_ms(200);
  26.             //PORTB &= ~i;
  27.            
  28.             //_delay_ms(200);
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement