![]() ![]() The original Raspberry Pi featured a stereo 3.5mm socket, and all A and B models since feature a four-pole socket that also includes composite video. Raspberry Pi computers, with the exception of the Zero range, all have audio output on board. ![]() See if you can make Morse code sounds by changing the duration of the sleep statement. Run it at the command line: python3 buzz.py Now, install the GPIO Zero Python library by typing this at the command line: sudo apt install python3-gpiozeroĬreate a file called buzz.py in your favourite editor and enter the following: import time from gpiozero import Buzzer buzzer = Buzzer(22) buzzer.on() time.sleep(1) buzzer.off() ![]() Try connecting a buzzer’s red wire (positive) to GPIO pin 22 (Broadcom numbering) and the black wire (ground) to any GND pin. A cheap active buzzer can be quickly added to Raspberry Pi’s GPIO. The simplest place to start is with the humble buzzer. Need to keep it simple and under a pound?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |