// For Attiny85
// Author: Nick Gammon
// Date: 29 November 2012
void setup()
{
pinMode (0, OUTPUT); // pin 5 // OC0A
pinMode (1, OUTPUT); // pin 6 // OC0B
pinMode (4, OUTPUT); // pin 3 // OC1B
// Timer 0, A side
TCCR0A = _BV (WGM00) | _BV (WGM01) | _BV (COM0A1); // fast PWM, clear OC0A on compare
TCCR0B = _BV (CS00); // fast PWM, top at 0xFF, no prescaler
OCR0A = 0; // duty cycle
// Timer 0, B side
TCCR0A |= _BV (COM0B1); // clear OC0B on compare
OCR0B = 0; // duty cycle
// Timer 1
TCCR1 = _BV (CS10); // no prescaler
GTCCR = _BV (COM1B1) | _BV (PWM1B); // clear OC1B on compare
OCR1B = 0; // duty cycle
OCR1C = 255; // frequency
} // end of setup
void loop() {
// YOUR CODE HERE
}