if data == "DO1H":
GPIO.output("P8_3", GPIO.HIGH)
dat= "Digital output 1 HIGH"
print(data)
elif data == "DI1":
if GPIO.input("P8_2"):
dat = "Digital input 1 HIGH"
else:
dat = "Digital input 1 LOW"
print(data)
elif data == "DI2":
if GPIO.input("P8_4"):
dat = "Digital input 2 HIGH"
else:
dat = "Digital input 2 LOW"
print(data)
In this is a part of my code I have a syntax error in the line (elif data == "DI2") I can't figure what is the error, as you can see the same part of code is repeated twice only I replaced "DI1" by "DI2" but in the first part there is no problem no syntax error only in the seconde part which is copied from the first the error appears, does anyone has an idea about that ? I am using python 3.5.1.
Aucun commentaire:
Enregistrer un commentaire