I’ve had pretty decent luck getting my Fio v3 to do just about everything I’ve wanted now. However, if I try to run the tone() function on any of its PWM pins, it locks up and becomes very hard to get back under my control. It doesn’t matter if anything’s actually attached to the pin, just running the command does it.
Also, I’m trying to power an LED with pin 14 and that’s causing similar behavior. I can do it with pin 3, no prob, but pin 14 is crashy.
I’m really hoping there’s a way around the tone() problem.
I have run into the same problem and found a solution. It seems there was a bug in the tone function for the Arduino Leonardo (which is similar to the Fio v3). A patch for the Arduino IDE was submitted last summer:
Now the Fio v3 core files are the same than for the Arduino Leonardo, except for a patch for the CPU frequency. This patch is now also part of the Arduino Leonardo core.
The solution is thus to copy the core files of a recent version of the Arduino IDE (that can be found in <path_to_arduino>/hardware/arduino/cores) to replace the ones from Fio v3 (hardware/Fiov3/cores/).
If you want to be able to use pin 14, you need to deactivate its use by the USB serial. To do that, you need to change the file hardware/Fiov3/variants/pins_arduino.h. You can apply the following patch to this file:
I am using an Fio V3, 3.3v which has ATmega32U4 running at 8MHz. I have this tone problem and it seems like the solution that is suggested in the links which is also included in 1.0.5 IDE release has is not fixing the issue for a processor that is running at 8MHz. Am I right? How can I get around this?