Draaiende motor op commando van knopje (WERKEND)
Dependencies: Encoder MODSERIAL mbed
Fork of P_controller_motor 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();