def get_pot_angle (lr='l'): """ Get angle of gripper from potentiometer. """ global pot_initialized, arduino if not pot_initialized: arduino = read_arduino.get_arduino() pot_initialized = True print "POT INITIALIZED" if lr == 'l': pot_reading = arduino.get_reading(1) else: pot_reading = arduino.get_reading(2) return pot_param1[lr]*pot_reading + pot_param2[lr]
def done(): global finished finished = True read_arduino.get_arduino().done()