Here is the reference to the auto tune library:
http://brettbeauregard.com/blog/2012/01/arduino-pid-autotune-library/
And the code:
https://github.com/br3ttb/Arduino-PID-AutoTune-Library/blob/master/PID_AutoTune_v0/PID_AutoTune_v0.cpp
@Wilberforce started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Here is the reference to the auto tune library:
http://brettbeauregard.com/blog/2012/01/arduino-pid-autotune-library/
And the code:
https://github.com/br3ttb/Arduino-PID-AutoTune-Library/blob/master/PID_AutoTune_v0/PID_AutoTune_v0.cpp