Home 2018 Forums Crumble Support Making noises?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2817
    killerwhat
    Participant

    Hello. Can a crumble output be used to make a sound along with a piezo sounder?

    #2824
    Joseph
    Keymaster

    Hi,

    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

    #2833
    Mike
    Participant

    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 4 years, 11 months ago by Mike.
    Attachments:
    You must be logged in to view attached files.
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.