Recently, I have been trying to make a variety of simple robot sounds using only tone(), delay(), and other basic syntax. My goal with this project is to have a set of sounds a simple that any robot could play with only a PWM pin. I need suggestions on types of sound to make. So far i only have a crude whistle and a random beeping sound.
Also any wisdom on smoother triangle waves would be appreciated.
You make a triangle by incrementing and then decrementing the counter output. Do this with an interrupt service routine connected to one of the timers.
Get the timer going at 38 kHz or so.
You can also make whooping noises by sliding the frequency output, or if you change it faster warbling noises.
Do not use delay at all, and the tone function is of limited use.
I always liked “Danger, Will Robinson!” while waving arms frantically about.
Probably best to have that played off an SD card with an MP3 module tho.
These are easy to use
May need to put a 10uF cap between (in series with) the Left & Right outputs and powered speaker inputs; I had 2 boards fail (eventually - played fine for a day or so initially, then just got high pitch whine, altho the serial interface was still working), MDFLY suggested the caps to eliminate any DC offset level issues. Replacement boards arrived yesterday, waiting to wire caps in and try it.
The card on the left (and middle I think, SD card vs micro SD card), you send it a serial command (track #, or a command).
The one on the right, you can push a button/take an input pin low to play one of 8 files, or send it serial commands.