-->
Page 1 of 2

Cannot get Arduino Tone too work = #include <Tone.h>

PostPosted: Sun Oct 18, 2015 5:29 am
by questuk
Hi

Have spent an hour trying to solve this and looked on the internet.

When i add this #include <Tone.h> i get a fatal error.

'libraries\Tone\Tone.cpp:24:27: fatal error: avr/interrupt.h: No such file or directory #include <avr/interrupt.h>'

But I am not sure if the Tone library has been implemented on the ESP8266 ?

Any help would be appreciated.

Regards

Gary

Re: Cannot get Arduino Tone too work = #include <Tone.h>

PostPosted: Sun Oct 18, 2015 5:47 am
by DAFlippers
Hi Gary,

Which library are you using? The tone() function is available in standard Arduino core https://www.arduino.cc/en/Reference/Tone although it only supports single tone. This does not require an include for the library.

David

Re: Cannot get Arduino Tone too work = #include <Tone.h>

PostPosted: Sun Oct 18, 2015 6:28 am
by questuk
Hi DAFlippers,

I have used it the past when using an actual Arduino.

But cannot get it to work on the ESP8266 ?
It does compile on the ESP8266 if I omit the #include <Tone.h>

But it doesn't produce any sound.


Regards


Gary

Re: Cannot get Arduino Tone too work = #include <Tone.h>

PostPosted: Sun Oct 18, 2015 9:02 am
by DAFlippers
Hi Gary,

I just tried it and I can confirm the tone function is not working.

I checked I had the correct pin by toggling it and tried setting it to an output before calling tone. Pin remains high when tone function called.

It would be worth posting in Bug Report viewforum.php?f=28.

David