Code: Select all
if (motor != 0): GPIO.output(13, 1) print "on",motor time.sleep(motor/1000.0) GPIO.output(13, 0) print "off" time.sleep((100.0-motor)/1000.0)
so I've changed motor to motor[0,0,0,0,0,0] and I've another list that indexes the pins - pinarray[11,12,13,15,16,18]
I'm looking for clever code to convert the single instance above to handle the 6 values in motor
Obviously it needs to switch each pin on for the correct amount of time and each one off for (near enough) the correct amount of time
Anyone got a super algorithim ?
PS its for my Scratch GPIO Handler