add a small example

This commit is contained in:
王开智 2019-09-06 10:20:40 +08:00 committed by GitHub
parent c7e0a717b6
commit f813bd161d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,13 @@
'''
Example:
from pid import PID
pid1 = PID(p=0.07, i=0, imax=90)
while(True):
error = 50 #error should be caculated, target - mesure
output=pid1.get_pid(error,1)
#control value with output
'''
from pyb import millis
from math import pi, isnan