questions about python
Go to solution
Solved by dany_boy,
Eliminate this:
while True:
GPIO.output(22,False)
GPIO.output(27,False)
GPIO.output(17,False)
while GPIO.input(24) == False: #rood
print("rood aan")
GPIO.output(17,True)
while GPIO.input(23) == False: #groen
print("groen aan")
GPIO.output(27,True)
while GPIO.input(18) == False: #blauw
print("blauw aan")
GPIO.output(22,True)
use if statements instead:
while true:
if GPIO.input(24) == False:
print("rood aan")
GPIO.output(17,True)
else:
GPIO.output(17,True)
repeat for each channel

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now