Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <avr/interrupt.h>
  2.  
  3. void setup() {
  4.  
  5. TCCR1A = B11110010;
  6. TCCR1B = B00011010; // preskaler 8
  7.  
  8. ICR1 = 3333 ;
  9. OCR1A = 400;
  10. OCR1B = 0;
  11. pinMode (11, OUTPUT);
  12. pinMode (12, OUTPUT);
  13. }
  14.  
  15. void loop()
  16. {
  17. unsigned int n;
  18.  
  19. for (unsigned int i = 0; i <500; i++) {
  20. OCR1B = 3333-(801+800*cos(2*PI/600*(300-i)));
  21. delay (4);
  22. }
  23. while(1) { }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement