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

GPIO cleanup

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

12 min read • Beginner
raspberry-pi-015.py
python
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM); GPIO.setup(17,GPIO.OUT)
try:
    GPIO.output(17,GPIO.HIGH)
finally:
    GPIO.cleanup()
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content