Audio card to play tones like the tone(audiopin,pitch,20) function

dheco · 2 · 2375

dheco

  • Newbie
  • *
    • Posts: 2
    • View Profile
I want to use the audio card with the tone() function as the output. It would be nice if left was one output and right was the other. My application needs continuous 10 to 20 Ms updates of the tone frequency with a 10 to 100 Hz resolution steps. I am not sure if playing wave files would meet that requirement.


Ben Rose

  • Administrator
  • Hero Member
  • *****
    • Posts: 392
    • View Profile
Our audio shield is mono, but the Tone library and most derivatives are also limited to a single tone at one time. They're also outputting a square wave, while our audio board has 12 bit DAC- this may or may not be useful for your application. You could potentially use the Tone library code as an example to write code to drive the DAC the way you want.

You probably can't change the WAV file playing every 10-20ms- I think you'd want to generate the output in software since it sounds like you may just need a square or maybe sine wave.


 

SMF spam blocked by CleanTalk