by on
Dorkbot

void setup(void)
{
...
TCCR1A = 0×00; // sets timer control bits to PWM Phase and Frequency Correct mode
TCCR1B = 0×12; // sets timer control bits to Prescaler N = 8
ICR1 = 0×07d0; // Upper Timer Limit = 2000 (in hex) equals 2ms
}

//after which you can analogWrite to pins 9 and 10

Leave a Reply

  • (will not be published)