- This topic has 2 replies, 3 voices, and was last updated 8 years, 1 month ago by
Mike.
-
AuthorPosts
-
October 23, 2015 at 9:00 am #2817
killerwhat
ParticipantHello. Can a crumble output be used to make a sound along with a piezo sounder?
October 25, 2015 at 11:24 pm #2824Joseph
KeymasterHi,
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,
Joseph
October 30, 2015 at 10:54 am #2833Mike
ParticipantI’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! 🙂
Attachments:
-
AuthorPosts
- You must be logged in to reply to this topic.