Tone Function For Variometer

Status
Not open for further replies.

Paraglider

Well-known member
I am working on a variometer for hang gliding / paragliding, based on a custom built Teensy 3.1. Now I would like to make the tone function a bit smoother. The actual code is as follows:

Code:
      if (toneEnable == 1){
        tVario = millis();
        tone(tonePin,frequency);
        toneEnable = 0;

      }

      if (millis() - tVario >= duration){
        noTone(tonePin);
      }

      if (millis() - tVario >= 2 * duration){
        toneEnable = 1;
      }

With Arduino Nano it was possible to call the tone function again and again, and change the frequency with each new call of the tone function. The sound was nice, but with Teensy 3.1 this doesn't work. The problem is now that the frequency is fixed, when calling the tone function the tone just get's switched on with the frequency that is given at the moment, but can not be changed later. It would be better for flying when the frequency of the tone could be changed while the tone is activated / beeping. How can I fix that?

For those that are interested there is in this project: There is an Indiegogo campaign running, details at https://www.indiegogo.com/projects/xc-tracer/
 
Status
Not open for further replies.
Back
Top