CrowPi Python Lesson 2:Get input from button to control the Buzzer

preview_player
Показать описание
After successfully demonstrating how to turn on and off the buzzer now it’s time to get things a bit more exciting. In this lesson, we’ll combine a button with the buzzer so the buzzer will turn on only
by pressing the button.
This time we’ll use 2 GPIO setups. One will be the GPIO.INPUT which will take in charge of the button as an input way to get the “press” another one will be the GPIO.OUTPUT which will send signal to the buzzer to make some noise.

📌 Get Crowpi - Raspberry PI Education Kit 👇

Download Python PDF Lesson:

📌 Let's subscribe and follow us to keep updated with the latest news and perks:

#Elecrow #CrowPi #Raspberrypi #electronics
Рекомендации по теме
Комментарии
Автор

Hi all, for those using the Raspberry Pi 4 version of the CrowPi, you need to make sure that "button_pin = 37" and "buzzer_pin = 12" and that "GPIO.setmode(GPIO.BOARD). The new Raspberry Pi 4 version of the CrowPi already includes the updated scripts so I am just putting this out there for anyone who has swapped out the Raspberry Pi 3 for a Raspberry Pi 4 on their CrowPi.

maxwalsh
visit shbcf.ru