Samenwerking Groep 12
Dependencies: Encoder MODSERIAL HIDScope mbed
Foo
Diff: main.cpp
- Revision:
- 16:8975d6c900f0
- Parent:
- 15:80af7a7671d4
- Child:
- 19:269f19917d80
--- a/main.cpp Mon Sep 21 15:02:31 2015 +0000 +++ b/main.cpp Mon Sep 21 15:05:33 2015 +0000 @@ -44,10 +44,10 @@ double Error_position=(reference-position)*motor2_Kp; pc.printf("positie = %d en Error_positie =%d \r\n", motor2.getPosition(), Error_position); //myControllerTicker.attach(&motor2_Controller,0.01f); - if (Error_position > 0) { + while (Error_position > 0) { motor2direction = 0; motor2speed=0.3f;} - else { + while (Error_position < 0) { motor2direction = 1; motor2speed=0.3f;} }