Opzetje

Dependencies:   mbed QEI HIDScope biquadFilter MODSERIAL FastPWM

Revision:
7:2f612f32711a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/motor.cpp	Tue Oct 01 14:45:37 2019 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+#include "MODSERIAL.h"
+#include "FastPWM.h" 
+
+Serial pc(USBTX,USBRX);
+
+InterruptIn button1(PTC2);
+InterruptIn button2(PTC3);
+InterruptIn button3(PTA4);
+InterruptIn button4(PTC6);
+
+AnalogIn pot(PTB2);
+
+//DigitalOut motor(D5);
+FastPWM lampje(D3);
+FastPWM motor(D5);
+Ticker ticker;
+
+
+void motor_speed()
+{
+    float f = pot.read();
+    pc.printf("%f\n\r",f);
+    motor.write(f);
+    lampje.write(f);
+}
+
+int main()
+{
+    ticker.attach(&motor_speed, 0.01f);
+    while(true){};
+} 
\ No newline at end of file