Use variable as input to audio library.

Status
Not open for further replies.

KRSO

Member
Hi.

I have a DC motor with an SPI 4000 count encoder attached. This results in a pretty nice sinus signal, and I would like to play it through the audio library.
How do I add the variable as an input?

Best Regards Kristian
 
You would either want to directly set the value of a DC audio object from the encoder, or use the queue object
https://www.pjrc.com/teensy/gui/?info=AudioPlayQueue
Audio quality from the DC object will depend on how fast you update the thing and what happens if you change it mid processing interval, suspect getting actual nice tones would require logging values into a buffer and then feeding them into the queue object to allow changes during the audio library interval
 
Status
Not open for further replies.
Back
Top