October 23, 2015 at 9:00 am #2817killerwhatParticipant
Hello. Can a crumble output be used to make a sound along with a piezo sounder?October 25, 2015 at 11:24 pm #2824JosephKeymaster
The Crumble can’t drive a piezo ‘musically’, but if you just need a buzz, there are a couple of ways to do it.
The first would involve writing a loop to toggle an output between HI and LO (without any delays). This should produce an audible tone, although it might be a little quiet.
The second way involves connecting the piezo to a motor output and setting the motor to 50% power. Because the motors are PWMed (Pulse Width Modulated), you should hear a 1kHz tone.
Hope this helps,
JosephOctober 30, 2015 at 10:54 am #2833MikeParticipant
I’ve had success by ripping the ‘speaker’ out of a pair of old headphones, connecting it to C and Ground, and running the attached code to generate tones. I haven’t managed to get it to run any faster, so this is the smallest step-between-tones I can achieve.
Note that if you run it disconnected, powered by battery, the tones get higher and smoother. I think because the crumble is not polling the computer while it runs?
Also see attached a ‘squeak’ sound! 🙂
- This reply was modified 5 years, 12 months ago by Mike.
Attachments:You must be logged in to view attached files.
- You must be logged in to reply to this topic.