rpi_zero_neopixel_buzzer/detect_buzz.py
2024-03-24 22:48:05 +01:00

11 lines
250 B
Python
Executable file

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Using GPIO to detect button
See https://gpiozero.readthedocs.io/en/stable/api_input.html
"""
from gpiozero import Button
buzzer = Button(16)
buzzer.wait_for_press()
print("The button was pressed!")