Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 1 of 1

Thread: Inverting analogRead floats

  1. #1

    Inverting analogRead floats

    Hi, I'm working on a wavetable oscillator with the audio library...I have inverting op amps to scale my inputs to the teensy range for the freq and amp and I'm trying to figure out how to invert the values again in the code.
    I've found ways to do it online with int's but not with floats so Im stumped. I can add another inverting op amp to the input but I'd prefer not to. Any ideas?

    P.S. the code is the standard one like in the example for the waveform synth

    Edit: nevermind i figured it out. For anyone else with this prob, in the loop, something like this:

    waveform1.frequency(20000 - (analogFreqSmooth1 * 20000));
    Last edited by fabuloso_mocoso; 10-21-2018 at 04:02 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts