Stereo siren from tone() example #201
Andy2No
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Not realising that this isn't meant to work, according to the arduino reference page for tone(), I tried making a stereo version of the siren example, on the Raspberry Pi Pico, and it works fine.
This is based on the tone() example for a simple siren : https://github.com/earlephilhower/arduino-pico/blob/master/libraries/rp2040/examples/Siren/Siren.ino
Here's the code for the stereo version, with an ascending tone siren in one ear, and a descending one in the other - so it's at least twice as maddening:
For the audio output, I used a 100k resistor from each of the two pins, to a stereo 3.5mm jack socket, with the ground pin grounded to one of the GND pins on the Pico.
That's good enough to feed directly to my FiiO E06 inexpensive headphones amp, which is quite tolerant of different input levels. For one that isn't, you might want to use potential dividers to reduce the voltage a bit more, e.g. a 50k resistor from the Pico pin to the socket, then another one from there to GND, on each channel. That would half the voltage at the socket.
Beta Was this translation helpful? Give feedback.
All reactions