Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup()
- {
- pinMode(3, OUTPUT); //D3
- TCCR2A = _BV(COM2B1) | _BV(COM2B0) | _BV(WGM20); //PWM
- TCCR2B = _BV(WGM22) | _BV(CS22) | _BV(CS21) | _BV(CS20); //div 1024
- OCR2A = 156; //20mS period
- OCR2B = 148;
- }
- void loop()
- {
- OCR2B = 140;
- delay(1000);
- OCR2B = 148;
- delay(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement