Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
menu_book Course Curriculum (Raspberry Pi) expand_more
Raspberry Pi / GPIO Digital I/O

button debounce

Learn button debounce in Raspberry Pi with a dedicated explanation, a concept-specific example, practical cautions, and a mastery check.

12 min read • Beginner
raspberry-pi-013.py
python
from gpiozero import Button
button=Button(2,pull_up=True,bounce_time=0.08)
button.when_pressed=lambda: print('single debounced press')
input('press Enter to stop')
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content