status = 0 def pressed(input): global status if input != status: if input == 1: status = 1 pressedAction() status = input actLED = -1 print "start" while 1: dist = readdist.readDist(distTrigger, distInput) print dist leds = min(len(dioden), int(dist / normaliser)) print leds setup() for port in dioden: GPIO.output(port, 0) for port in dioden[0:leds]: GPIO.output(port, 1) time.sleep(0.1) GPIO.cleanup()
def readLeft(): return readdist.readDist(16,18)
import readdist print readdist.readDist(16,22)
def readRight(): return readdist.readDist(16,22)
import readdist print readdist.readDist(16,18)