Draaiende motor op commando van knopje (WERKEND)
Dependencies: Encoder MODSERIAL mbed
Fork of P_controller_motor by
Diff: main.cpp
- Revision:
- 10:1d8b21515ed1
- Parent:
- 9:3278558361a5
- Child:
- 11:c5befe79aa53
--- a/main.cpp Thu Sep 17 12:33:42 2015 +0000 +++ b/main.cpp Thu Sep 17 12:53:08 2015 +0000 @@ -3,8 +3,9 @@ #include "encoder.h" // Define the HIDScope and Ticker object -HIDScope scope(1); -Ticker scopeTime; +HIDScope scope(2); +Ticker scopeTimer; +Ticker motorP; // Define Encoder @@ -42,19 +43,19 @@ } // Read the analog input -float triangle_signal = 2.05; + // The data read and send function void scopeSend() { - scope.set(0,motorP); + scope.set(0,Ticker motorP); scope.send(); } int scopeattach() { // Attach the data read and send function at 100 Hz - scopeTimer.attach_us(&scopeSend, 2e4); + scopeTimer.attach_us(&scopeSend, 1e4); while(1) { } }