Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 28:15b95329a064
- Parent:
- 27:949a31d30439
- Child:
- 29:6aa49bba0d81
--- a/main.cpp Wed Aug 05 05:57:37 2015 +0000 +++ b/main.cpp Thu Aug 06 02:16:53 2015 +0000 @@ -8,7 +8,11 @@ led4 = 1; int sensors[5]; - float position = 0; + float position = 0.0; + static float previous_position = 0.0; + static float integral; + + //get sensors pi.sensor_reading(sensors); @@ -16,6 +20,8 @@ //line position position = pi.line_position(); + + // Do your control calculations here ////////////////////////////////////