Dear All After receiving UDOO, I found it is Arduino Due Model. But I practicing the sounder experience, I need tone() instruction. But it seems can't work for this model. So How can I replace this instruction or have something new ideas? Code: float sinVal; int toneVal; void setup() { // put your setup code here, to run once: pinMode(8,OUTPUT); } void loop() { // put your main code here, to run repeatedly: for(int x=0;x<180;x++){ sinVal = (sin(x*(3.1412/180))); toneVal = 2000+(int(sinVal*1000)); tone(8,toneVal); delay(2); } }
Hi, Which is the problem?The application doesn't compile or when you launch the application you can't hear sound?
My problem is 1. use tone can't compile, how to solve arduino due rev can't use tone and notone,even though I've import its library. (# include <Tone.h>) 2. I've check /opt/arduino-1.5.4/hardware/cores/arduino/ Tone.h and Arduino.h and I check its content with entry for "Tone.h". In network, I found the method, but its not work.(tone.h rename to arduino.h) 3. How can I find a new instruction method for replacing tone and notone?
3: if I remember well, this example plays tones without using tone(); http://www.arduino.cc/en/Tutorial/PlayMelody It is just a matter of turning a pin current hi, waiting the correct time, then low, waiting the correct time, then hi, etc.. You are manually generating the wave. Correct wait times for some notes are listed in the script (if I remember well). You can adjust volume (0-255) too by using analog output instead of digital hi vs low (if I remember well). [P.S:. of course on UDOO you can play (much better) audio on the Linux side easily, but you probably know]
Dear all tone() is not supported. If I compile a Sketch with tone() I get error message: - error: 'tone' was not declared in the scope There is nothing written about it in chapter "Arduino differences". Is there a solution? Best regards!
What Udoo are you on? This discussion started for a Udoo Dual/Quad. I think you have a Udoo Neo right? Then you have to use something like TimerFreeTone For more info alo look here https://bitbucket.org/teckel12/arduino-timer-free-tone/wiki/Home