PID_controler voor het latere script
Dependencies: HIDScope MODSERIAL QEI biquadFilter mbed
Diff: main.cpp
- Revision:
- 4:61d9325d7f2e
- Parent:
- 3:56f31420abac
--- a/main.cpp Thu Nov 03 14:31:56 2016 +0000 +++ b/main.cpp Thu Nov 03 14:37:04 2016 +0000 @@ -5,7 +5,7 @@ #include "HIDScope.h" #include "math.h" -DigitalIn sw3(SW3); +InterruptIn sw3(SW3); DigitalIn sw2(SW2); DigitalIn encoder1A(D13); DigitalIn encoder1B(D12); @@ -155,7 +155,7 @@ float rev_counts_motor1; float rev_counts_motor2; // variabele coutns voor motor2 //t.attach(&tickerfunctie,ticker_TS); -sw3.attach(&SwitchN,Ts); +sw3.fall(&SwitchN); tick.attach(&reference,Ts); tick2.attach(&reference2,Ts); // ticker voor reference2 attach controllerticker.attach(&m1_controller,Ts);