Editing Piezo Speaker
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
= Description = | = Description = | ||
A Piezo-Speaker has two connectors and can generate sounds if you apply a frequency. One is + and one is -. If you connect it to the ESP + is connected to the Pin and - to GND. | A Piezo-Speaker has two connectors and can generate sounds if you apply a frequency. One is + and one is -. If you connect it to the ESP + is connected to the Pin and - to GND. | ||
− | + | [[file:Piezo_Speaker_close_up.jpg|300px]] | |
− | + | = How to connect it electrically = | |
− | + | [[File:Piezzo.PNG]] | |
− | [[File: | ||
− | |||
− | |||
= How to control it in MicroPython = | = How to control it in MicroPython = | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Example code shows how you can play a melody with the speaker. If you want to add higher notes see https://en.wikipedia.org/wiki/Piano_key_frequencies for the needed frequency. The example code was taken and edited from https://micropython-on-esp8266-workshop.readthedocs.io/en/latest/basics.html#beepers. | Example code shows how you can play a melody with the speaker. If you want to add higher notes see https://en.wikipedia.org/wiki/Piano_key_frequencies for the needed frequency. The example code was taken and edited from https://micropython-on-esp8266-workshop.readthedocs.io/en/latest/basics.html#beepers. | ||
− | |||
− | |||
<syntaxhighlight lang="python" line='line'> | <syntaxhighlight lang="python" line='line'> | ||
Line 68: | Line 43: | ||
[[file:Piezo_Speaker.jpg|300px]] | [[file:Piezo_Speaker.jpg|300px]] | ||
[[file:Piezo_Speaker_close_up.jpg|300px]] | [[file:Piezo_Speaker_close_up.jpg|300px]] | ||
− | |||
− | |||
− |