Werkende motor + werkende HIDscope, 2 channels, aansturing met PC.

Dependencies:   Encoder HIDScope MODSERIAL mbed

Fork of frdm_Motortryout2 by Margreeth de Breij

Files at this revision

API Documentation at this revision

Comitter:
Rvs94
Date:
Mon Sep 21 13:39:29 2015 +0000
Parent:
8:44d4f2eb6a81
Commit message:
Werkende motor, aangestuurd door pc, incl werkende HIDscope met twee kanalen. Nog niet werkend: Direction in HIDscope

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Sep 21 12:47:49 2015 +0000
+++ b/main.cpp	Mon Sep 21 13:39:29 2015 +0000
@@ -8,12 +8,14 @@
 DigitalOut motor2direction(D4); //D4 en D5 zijn motor 2 (op het motorshield)
 PwmOut motor2speed(D5);
 DigitalIn button1(SW3);
-HIDScope scope(1);
+HIDScope scope(2);
 Ticker ScopeTime;
+AnalogIn a_in(A0);
 
 void ScopeSend()//Functie die de gegevens voor de scope uitleest en doorstuurt
 {
-    scope.set(0, motor2direction.read());
+    scope.set(0, motor2speed.read());
+    scope.set(1, a_in.read());
     scope.send();
 }
 
@@ -36,7 +38,7 @@
                 case 'f':
                 {
                     motor2direction = 1;
-                    motor2speed = 0.5f;
+                    motor2speed = 0.9f;
                     pc.printf("het werkt\n");
                     wait(1);
                     led = 0;