Startup
This commit is contained in:
18
script/test/TestPIDOld.py
Normal file
18
script/test/TestPIDOld.py
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
#Qhttps://github.com/tekdemo/MiniPID-Java
|
||||
PID = get_context().getClassByName("MiniPID")
|
||||
|
||||
|
||||
target = 41.0
|
||||
pid=PID(0.2,0,0)
|
||||
pid.setSetpoint(target)
|
||||
pid.setOutputLimits(-100, 100)
|
||||
while True:
|
||||
sensor = out.read()
|
||||
|
||||
#set some sort of target value
|
||||
output=pid.getOutput(sensor)
|
||||
print output
|
||||
#do something with the output
|
||||
inp.write(output)
|
||||
time.sleep(1.0)
|
||||
Reference in New Issue
Block a user