Embed presentation
Download to read offline


This Python code controls a buzzer connected to a Raspberry Pi by turning the buzzer on and off using GPIO pin 23. It imports the RPi and time libraries, sets the GPIO mode and pin 23 as an output, then enters a forever loop that sets the pin high to turn the buzzer on for 0.5 seconds, prints "Beep", sets the pin low to turn the buzzer off for 0.5 seconds, and prints "No Beep", repeating continuously.
