hexagon5un / AVR-Programming

Code examples for the book "Make: AVR Programming"
http://littlehacks.org/AVR-Programming
MIT License
725 stars 340 forks source link

Chapter 9: timerAudio.c #15

Closed zenabis closed 8 years ago

zenabis commented 8 years ago

At the beginning of the playNote function, there should be a counter reset, I think. Otherwise some tones get skipped in my case. (It's more problematic for me, since I use an Atmega8 with the 16bit counter).

hexagon5un commented 8 years ago

Interesting problem. I must have missed it b/c the 8-bit counter rolls around fast enough anyway.

I added in a TCCNT0=0; which should do it.

Thanks for the catch!