Raspberry Pi - GPIO Basics with Python
What will be the output of this code snippet if an error occurs during the loop?
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)
try:
for i in range(3):
if i == 1:
raise Exception('Error!')
GPIO.output(18, GPIO.HIGH)
finally:
GPIO.cleanup()
print('Program ended')