Arduino Forum
>
Products
>
Arduino Due
(Moderator:
fabioc84
)
>
Tone function does not work with Arduino Due in arduino-1.5.1r2
Print
Go Down
Pages:
[1]
Topic: Tone function does not work with Arduino Due in arduino-1.5.1r2
(Read 4617 times)
previous topic
-
next topic
Zendue
Guest
Tone function does not work with Arduino Due in arduino-1.5.1r2
Dec 29, 2012, 04:14 pm
I have a similar thread to this one in the Programming Questions section of the Forum. I hope it's OK I started one here (I don't know how to move that one over).
I'm fairly certain that the Tone function does not work with the Arduino Due. I get the errors similar to the following each time it's called out when I tried to compile the code:
"toneMelody.ino: In function 'void setup()':
toneMelody:36: error: 'tone' was not declared in this scope
toneMelody:43: error: 'noTone' was not declared in this scope"
If I change the board to the the Arduino Uno the program compiles fine.
I looked at the Tone.cpp using a text editor. It has if statements for (__AVR_ATmega8__) or for (__AVR_ATmega1280__)
not for the Atmel SAM3X8E ARM Cortex-M3 CPU.
I'm thinking code needs to be added to Tone.cpp so that it will work with the Arduino Due.
Does anyone have a fix for this or am I just doing something wrong (I'm very new to this)?
jgmdavies
Jr. Member
Posts: 52
Karma: 16
[add]
Re: Tone function does not work with Arduino Due in arduino-1.5.1r2
#1
Dec 29, 2012, 05:01 pm
Hi,
Don't bother including Tone.h for the Due (take a look inside it!).
The nearest I've seen so far to getting something going is:
Quote from: cmaglie on Nov 29, 2012, 10:44 am
Jim
mantoui
Full Member
Posts: 127
Karma: 31
[add]
Re: Tone function does not work with Arduino Due in arduino-1.5.1r2
#2
Dec 29, 2012, 06:30 pm
If you want to build your own, a proof-of-concept sketch for Tone can be found at
http://arduino.cc/forum/index.php/topic,136500.msg1029238.html#msg1029238
Zendue
Guest
Re: Tone function does not work with Arduino Due in arduino-1.5.1r2
#3
Dec 30, 2012, 03:32 am
Thanks for your help.
I appreciate it.
Zendue
Guest
Re: Tone function does not work with Arduino Due in arduino-1.5.1r2
#4
Dec 30, 2012, 04:43 am
The code works great. Shave and a hair cut. How fun is that.
Thanks again.
Print
Go Up
Pages:
[1]
Loading...