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.
Dependencies: Encoder MODSERIAL mbed
Fork of P_controller_motor_Bouke by
Diff: main.cpp
- Revision:
- 8:80cb1f5d561e
- Parent:
- 7:961dcef17e08
- Child:
- 9:3278558361a5
diff -r 961dcef17e08 -r 80cb1f5d561e main.cpp
--- a/main.cpp Thu Sep 17 12:14:26 2015 +0000
+++ b/main.cpp Thu Sep 17 12:18:40 2015 +0000
@@ -25,12 +25,10 @@
{
return Kp*error;
}
-
-// Motor function
// Error measurement and apply the output to the plant
-void motorP_Controller()
+double motorP_Controller()
{
double reference_position = potmeter1.read();
double position = Convert_volt_to_position*encoder1.getPosition();
