Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <avr/interrupt.h>
- void setup() {
- TCCR1A = B11110010;
- TCCR1B = B00011010; // preskaler 8
- ICR1 = 3333 ;
- OCR1A = 400;
- OCR1B = 0;
- pinMode (11, OUTPUT);
- pinMode (12, OUTPUT);
- }
- void loop()
- {
- unsigned int n;
- for (unsigned int i = 0; i <500; i++) {
- OCR1B = 3333-(801+800*cos(2*PI/600*(300-i)));
- delay (4);
- }
- while(1) { }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement