Corrected header file include guards.

Dependencies:   FiniteStateMachine HipControl Knee LinearBlend1 LocalFileSystem_Read dataComm hapticFeedback initExoVars mbed Blend_Generator Brad_poly_gait Gait_Generator MM_gait Encoders IMUdriver

Fork of Motion Control by HEL's Angels

Revision:
3:9719ad064a2c
Parent:
2:89b78367d173
Child:
5:498c9bfc56f0
--- a/main.cpp	Mon Nov 24 03:35:08 2014 +0000
+++ b/main.cpp	Fri Feb 13 23:00:57 2015 +0000
@@ -1,5 +1,4 @@
 /**************************************
-
 This is the main file for the "RyanEXO" control software.
 This sets up the main control loop that operates at a 1kHz frequency
 and controls the flow of the rest of the software
@@ -9,23 +8,33 @@
 sensors: 2 Austria Microsystems 12 bit magnetic encoders, handled by encoders.h
 motors: 2 maxon EC90 DC brushless motors, handled by HipMotorControl.h (called in FSM.h)
 Knees: wrap spring clutch controlled by Firgelli PQ12P linear actuators, controlled in linearActuatorControl.h
+**************************************/
 
-**************************************/
 #include "mbed.h"
 #include "initExoVars.h"
 #include "FSM.h"
 #include "dataBedComm.h"
 int dataIn[4];
 int dataOut[]={0xFF,30,31,0xFE};
+
 ///////////////////////////////////////////////////////////////////////////
+
+// periodicFcns runs at the start of every control loop cycle
+// It initiates communication with dataBed, checks for errors/safety, and starts the FSM
 void periodicFcns()
 {
     dataOut[1]=encoder_L.readRaw();
     dataOut[2]=encoder_R.readRaw();
     int* ptr=dataIn;
     ptr=sendData(dataOut, 4, dataIn);
-    pc.printf("%d, %d, %d, ", dataIn[0], dataIn[1], dataIn[2], dataIn[3]);
+    // why only 3 of the %d?
+    pc.printf("%d, %d, %d, %d, ", dataIn[0], dataIn[1], dataIn[2], dataIn[3]);
+    
+
+    
+    // Run state change/analysis in FSM
     int exoState=fsm.state(dataIn[1]);
+    
 
 }
 
@@ -33,7 +42,7 @@
 {
     pc.printf("ExoStart \r\n");
     initializeExoIOs();
-    pc.printf("Blah\r\n");
+    // pc.printf("Blah\r\n");
 
     pc.printf("Starting exo...\n\r");
     //If desired, a startup sound can be played. This function is defined in the DatabedCode, because it will command a sound to be played once it detects a heartbeat from ControlBed