Pages: [1]   Go Down
Author Topic: toneMelody problem in 0019  (Read 382 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Newbie poster here: hope I'm putting this in the right place! Maybe it should be under Bugs, but... smiley

I just started with the Arduino a few days ago, and was using version 0018. The toneMelody example in that version loaded and executed just fine. Today I switched over to version 0019, and found that when toneMelody is executed, only the first note is correct. The following notes do play, but the pitch is (way) wrong. I checked the tone values being used via serial monitor and they are the same.
I see that one of the changes made in 0019 was to the tone() function, and I wonder what needs to be done to get the code to work correctly again?

I'm using a Duemilanove, BTW. Thanks... Tim
« Last Edit: September 05, 2010, 09:53:51 pm by MaineTim » Logged

Oxford (England)
Offline Offline
Jr. Member
**
Karma: 0
Posts: 58
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This looks to be a bug in tone(), introduced in 0019 (whilst fixing "Issue 228: PWM remains disabled after tone() ends".)

A temporary work-round would be to insert noTone(smiley-cool; just before the tone comand. That'll work because it ensures that the underlying timer is re-initialised correctly on subsequent tone calls.

[edit: the issue is already logged : Issue 361 : tone command no longer plays frequencies accurately]
« Last Edit: October 12, 2010, 03:02:01 pm by condemned » Logged

Pages: [1]   Go Up
Jump to: