# ------------------------------------------------------------
# Copyright © 2026/2027 Dr. Mohammad Alja'afreh. All rights reserved.
# PSUT IoT Engineering Learning Platform
# ------------------------------------------------------------
# ---- Import Button from gpiozero.
from gpiozero import Button
 
# ---- Create a button object on BCM pin 18.
# pull_up=True means the input is normally high and goes low when pressed.
button = Button(18, pull_up=True)
 
# ---- Wait for one press event.
print("Waiting for button press...")
button.wait_for_press()
print("Button was pressed.")
