Advertisement
ivosexa

Untitled

Dec 25th, 2014
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #define F_CPU 1000000UL
  2. #include <avr/io.h>
  3. #include <util/delay.h>
  4. int main(void)
  5. {
  6. DDRB = 0xff ;
  7.  
  8. TCCR1A |= 1<<WGM11 | 1<<COM1A1 ;
  9. TCCR1B |= 1<<WGM13 | 1<<WGM12 | 1<<CS10 ;
  10. ICR1 = 19999;
  11. while (1)
  12. {
  13.  
  14. OCR1A =1000;
  15. _delay_ms(1000);
  16.  
  17.  
  18.  
  19. OCR1A =1400;
  20. _delay_ms(1000);
  21.  
  22. OCR1A =1800;
  23. _delay_ms(1000);
  24.  
  25.  
  26.  
  27.  
  28.  
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement