This commit is contained in:
17
script/test/TestPID.py
Normal file
17
script/test/TestPID.py
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
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)
|
||||
Reference in New Issue
Block a user