Reputation: 45
im trying to use a if statement to print if the led is on but the ide is ignoring the if statement and only doing whats outside it also ive tried using the gpiozero library but it reads the pins wrong i dont have any jumpers connected to pin 17 but its the only pin that turns the led on
from rpi.gpiozero import LED
import time
GPIO.setmode(GPIO.BOARD
GPIO.setup(11,GPIO.OUT)
for i in range(25):
GPIO.OUTPUT(11,True)
if GPIO.OUTPUT(11,True):
print('LED is on')
time.sleep(1)
GPIO.OUTPUT(11,False)
if GPIO.OUTPUT(11,False):
print('LED is off')
time.sleep(1)
GPIO.CLEANUP()
Upvotes: 0
Views: 118