Stap 4: De programmering
het hele ding onder de regel is het programma
Kopieer het programma en plak deze in de python 2
-----------------------------------------------------------------------------------------------------------------------------------------------------
importeren van RPi.GPIO als GPIO
importeren
GPIO.setmode (GPIO. RAAD VAN BESTUUR)
GPIO.setwarnings(False)
GPIO.setup (31, GPIO. UIT)
GPIO.setup (32, GPIO. UIT)
GPIO.setup (33, GPIO. UIT)
GPIO.setup (35, GPIO. UIT)
GPIO.setup (36, GPIO. UIT)
GPIO.setup (37, GPIO. UIT)
GPIO.setup (38, GPIO. UIT)
GPIO.setup (40, GPIO. UIT)
voor x in range(0,1):
GPIO.output(35,True)
GPIO.output(36,True)
GPIO.output(37,True)
GPIO.output(38,True)
GPIO.output(33,True)
GPIO.output(31,True)
time.Sleep(0.5)
GPIO.output(35,False)
GPIO.output(36,False)
GPIO.output(37,False)
GPIO.output(38,False)
GPIO.output(33,False)
GPIO.output(31,False)
time.Sleep(0.5)
GPIO.output(35,True)
GPIO.output(36,True)
GPIO.output(37,True)
GPIO.output(38,True)
GPIO.output(33,True)
GPIO.output(31,True)
GPIO.output(32,True)
time.Sleep(0.5)
GPIO.output(35,False)
GPIO.output(36,False)
GPIO.output(37,False)
GPIO.output(38,False)
GPIO.output(33,False)
GPIO.output(31,False)
GPIO.output(32,False)
time.Sleep(0.5)
GPIO.output(35,True)
GPIO.output(37,True)
GPIO.output(38,True)
time.Sleep(0.5)
GPIO.output(35,False)
GPIO.output(37,False)
GPIO.output(38,False)
time.Sleep(0.5)
GPIO.output(35,True)
GPIO.output(36,True)
GPIO.output(38,True)
GPIO.output(33,True)
GPIO.output(31,True)
GPIO.output(32,True)
time.Sleep(0.5)
GPIO.output(35,False)
GPIO.output(36,False)
GPIO.output(38,False)
GPIO.output(33,False)
GPIO.output(31,False)
GPIO.output(32,False)
time.Sleep(0.5)
GPIO.output(35,True)
GPIO.output(36,True)
GPIO.output(38,True)
GPIO.output(33,True)
GPIO.output(31,True)
time.Sleep(0.5)
GPIO.output(35,False)
GPIO.output(36,False)
GPIO.output(38,False)
GPIO.output(33,False)
GPIO.output(31,False)
time.Sleep(0.5)
GPIO.output(37,True)
GPIO.output(38,True)
GPIO.output(33,True)
GPIO.output(31,True)
time.Sleep(0.5)
GPIO.output(37,False)
GPIO.output(38,False)
GPIO.output(33,False)
GPIO.output(31,False)
time.Sleep(0.5)
GPIO.output(35,True)
GPIO.output(36,True)
GPIO.output(37,True)
GPIO.output(38,True)
GPIO.output(31,True)
time.Sleep(0.5)
GPIO.output(35,False)
GPIO.output(36,False)
GPIO.output(37,False)
GPIO.output(38,False)
GPIO.output(31,False)
time.Sleep(0.5)
GPIO.output(35,True)
GPIO.output(36,True)
GPIO.output(37,True)
GPIO.output(31,True)
GPIO.output(32,True)
time.Sleep(0.5)
GPIO.output(35,False)
GPIO.output(36,False)
GPIO.output(37,False)
GPIO.output(31,False)
GPIO.output(32,False)
time.Sleep(0.5)
GPIO.output(37,True)
GPIO.output(38,True)
time.Sleep(0.5)
GPIO.output(37,False)
GPIO.output(38,False)
time.Sleep(0.5)
GPIO.output(35,True)
GPIO.output(36,True)
GPIO.output(37,True)
GPIO.output(38,True)
GPIO.output(33,True)
GPIO.output(32,True)
time.Sleep(0.5)
GPIO.output(35,False)
GPIO.output(36,False)
GPIO.output(37,False)
GPIO.output(38,False)
GPIO.output(33,False)
GPIO.output(32,False)
time.Sleep(0.5)
GPIO.output(40,True)
time.Sleep(0.5)
GPIO.output(40,False)
GPIO.cleanup()
------------------------------------------------------------------------------------------------------------------------------------------------------
Ik hoop dat u genoten van deze eenvoudige tutorial