Poah als je je encoder in je motor wil aflezen en de beweging van je motor wilt aanpassen is dit programma echt voor jou!

Dependencies:   mbed QEI HIDScope biquadFilter MODSERIAL FastPWM

Files at this revision

API Documentation at this revision

Comitter:
Jellehierck
Date:
Mon Oct 07 07:28:56 2019 +0000
Parent:
5:54ce02ad7a50
Commit message:
Cleaned up code, removed unnecessary bits

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 54ce02ad7a50 -r c352578a95b3 main.cpp
--- a/main.cpp	Fri Oct 04 13:24:06 2019 +0000
+++ b/main.cpp	Mon Oct 07 07:28:56 2019 +0000
@@ -5,24 +5,26 @@
 //#include "BiQuad.h"
 #include "FastPWM.h"
 
-DigitalOut ledr(LED_RED);
-DigitalOut ledg(LED_GREEN);
-DigitalOut ledb(LED_BLUE);
-PwmOut led1(D10);
+// Button and potmeter control
 InterruptIn button1(D11);
 InterruptIn button2(D10);
 AnalogIn potmeter(A0);
-DigitalIn sw(SW2);
-MODSERIAL pc(USBTX, USBRX);
+
+// Encoder
 DigitalIn encA(D13);
 DigitalIn encB(D12);
 QEI encoder(D13,D12,NC,64,QEI::X4_ENCODING);
 
+// Motor
 DigitalOut motor2Direction(D4);
 FastPWM motor2Power(D5);
 DigitalOut motor1Direction(D7);
 FastPWM motor1Power(D6);
 
+// PC connection
+MODSERIAL pc(USBTX, USBRX);
+
+// Intializing tickers
 Ticker motorTicker;
 Ticker encoderTicker;