|
|
1bit square waves will
1bit square waves will produce a reasonable sound, check out this project as an example. If your micro clock is running pretty fast, then you can do some quite clever sine-wave emulation too, but this is certainly not necessary for producing simple (or even many more complex) tones.
Apparently the Sound function in Bascom is a little unreliable, but I can’t say I’ve used it myself. Perhaps you’d be better off using a timer routine to handle sound waveform generation.
What core frequency is your Mega32 running at?
RE
$crystal = 8000000 ’ internal resonator
I read the posts on the Allura project. This gave me a couple new ideas. I’ll try a different routine to drive the amp with a timer.
I’ll reply again after I try it. Thanks!!!
One more thing, I’m going to test with a different speaker as part of this. Just to see if there’s a noticeable difference.
RE
I still haven’t found a good solution that makes the notes sound like notes. (its all fax modem sounding)
So I bought a Bascom book from the manufacturers website, and they list sample code to make a little 8 switch piano.
The catch is they don’t use the “sound” command I’ve been messing with. So I’m gonna try this new code and move forward from here.
But if this doesn’t work then I’ll go a different direction to add additional musical sounds from this robot.
Thanks!!!