PID = get_context().getClassByName("PID") pid=PID(1,1,1); while True: sensor = sin.read() target = 30.0 #set some sort of target value output=pid.getOutput(sensor,target); print output #do something with the output inp.write(output) time.sleep(1.0)