doet met lampjes

Dependencies:   mbed QEI MODSERIAL FastPWM biquadFilter

Fork of StateMachJerry by Astrid Schut

Files at this revision

API Documentation at this revision

Comitter:
aschut
Date:
Sat Apr 20 16:35:00 2019 +0000
Parent:
12:f8e84d287a22
Commit message:
Alles gedocumenteerd

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sat Apr 20 16:31:07 2019 +0000
+++ b/main.cpp	Sat Apr 20 16:35:00 2019 +0000
@@ -846,7 +846,7 @@
                 stateChanged = false;
             }
 
-            // State transition logic: naar FREEZE (button2), naar MOTORS_OFF(button3) anders naar MOVEMENT
+            // State transition logic: naar FREEZE (button2), naar MOTORS_OFF(button3), na vijf min automatisch naar HOMING, anders naar MOVEMENT
             if (!button2) {
                 currentState = FREEZE;
                 stateChanged = true;
@@ -883,7 +883,7 @@
             }
             break;
 
-        case FREEZE:
+        case FREEZE:                                        //Koppelt motoren los van EMG input, de motoren zullen niet meer bewegen
             // Actions
             if (stateChanged) {
                 // state initialization: blue
@@ -898,7 +898,7 @@
                 stateChanged = false;
             }
 
-            // State transition logic: automatisch terug naar MOVEMENT.
+            // State transition logic: button 2 terug naar MOVEMENT.
             if (!button2) {
                 currentState = MOVEMENT;
                 stateChanged = true;
@@ -916,13 +916,13 @@
 int main()
 {
 
-    t2.start();
-    int counter = 0;
-    pwmpin1.period_us(60);
-    //PotRead.attach(ContinuousReader,Ts);
-    pc.baud(115200);
+    t2.start();                                 //Timer voor printen naar matlab
+    int counter = 0;                            //Counter voor printen naar matlab
+    pwmpin1.period_us(60);                      // PWM periode voor motoren is 60 microseconden
+    //PotRead.attach(ContinuousReader,Ts);      //Gebruikt in test fase voor aflezen potmeters
+    pc.baud(115200);                            // om naar de PC te printen
 
-//BiQuad Chain add
+//BiQuad Chain add (voegt de filters samen tot een reeks)
     highp1.add( &highp1_1 ).add( &highp1_2 ).add( &notch1_1 );
     highp2.add( &highp2_1 ).add( &highp2_2 ).add( &notch2_1 );
     highp3.add( &highp3_1 ).add( &highp3_2 ).add( &notch3_1 );
@@ -932,7 +932,7 @@
         led1 = 1;
         led2 =1;
         led3 =1;
-        /*
+        /* //Dit is voor het printen naar matlab
         if(counter==10)
             {
             float tmp = t2.read();
@@ -941,7 +941,7 @@
             }
         counter++;
         */
-        ProcessStateMachine();
+        ProcessStateMachine();              //Zet de statemachine aan
 
 
         wait(0.001);