The missing 3 lines of code

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

Comments

3 responses to “The missing 3 lines of code”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.