
Werkend aansturingsscript voor 2 motoren, incl werkende program switch. Motoren oscilleren nog iets. Vuur mechanisme ontbreekt nog.
Dependencies: HIDScope MODSERIAL QEI biquadFilter mbed
Fork of frdm_Motor_V2_2 by
Diff: main.cpp
- Revision:
- 22:56c3a5918bfc
- Parent:
- 20:f5091e29cd26
--- a/main.cpp Fri Oct 02 17:22:17 2015 +0000 +++ b/main.cpp Sat Oct 03 14:04:36 2015 +0000 @@ -20,7 +20,6 @@ //Tickers Ticker ScopeTime; Ticker myControllerTicker; -Ticker PrintTime; //Startwaarden double reference; @@ -54,12 +53,6 @@ } -// PC Printf -void PCPrintf() -{ - pc.printf("position = %f aantal degs = %f, count = %i\n",reference,position,count); -} - // Biquad filter double biquad( double u, double &v1, double &v2, const double a1, const double a2, const double b0, const double b1, const double b2 ) { @@ -101,7 +94,7 @@ { motor2direction = 1; } - + } int main() @@ -112,9 +105,8 @@ pc.baud(115200); pc.printf("Tot aan loop werkt\n"); - ScopeTime.attach_us(&ScopeSend, 10e4); - myControllerTicker.attach( &motor2_Controller, 0.01f ); // 100 Hz - PrintTime.attach(&PCPrintf,0.1f); + ScopeTime.attach(&ScopeSend, 0.01f); + myControllerTicker.attach( &motor2_Controller, 0.1f ); // 100 Hz while(true) { char c = pc.getc(); @@ -168,6 +160,7 @@ LedR = LedG = 1; LedB = 0; } + pc.printf("position = %f aantal degs = %f, count = %i\n",reference,position,count); } } \ No newline at end of file