most functionality to splashdwon, find neutral and start mission. short timeouts still in code for testing, will adjust to go directly to sit_idle after splashdown

Dependencies:   mbed MODSERIAL FATFileSystem

Revision:
52:f207567d3ea4
Parent:
51:c5c40272ecc3
Child:
53:c0586fe62b01
--- a/main.cpp	Mon Jun 04 15:20:21 2018 +0000
+++ b/main.cpp	Wed Jun 06 19:18:47 2018 +0000
@@ -1,36 +1,12 @@
 /*
-    Modified 2018-02-01 revA by Troy
-        - Fixed bugs with file opening and closing
-        - Made a directory printing function in the MbedLogger class that does not use the Directory List library (removed)
-    Modified 2018-02-02 revA by Troy
-        - Placed mbed file transmitter functionality into MbedLogger class
-        - created a macro for printing out files to PC and serial port simultaneously (placed in main)
-    Modified 2018-02-07 revA by Troy
-        - SDFileSystem class added to code along with sd card file system in System "StaticDefs"
-        - Had to fix bug with SDFileSystem, the imported version uses a buggy FATFileSystem class
-        - Update came from https://os.mbed.com/teams/mbed-official/code/FATFileSystem/  (not the library importer tool)
-        - Modified MbedLogger constructor to include string for file system, e.g. "/sd/" and "/local/"
-        - Modified MbedLogger class to use local or sd card
-        - Created SD card file system using reader on pins p11, p12, p13, p14 (SPI interface)
-    Modified 2018-02-08 revA by Troy
-        - Test code without ADC running to check behavior (timing issue)
-        - Modified sequence to use sequence.txt and fixed warnings
-        - Fixed CRC issue with file reception (the command that the MBED sends out)
-        - Issue with IMU data on p27, need to check wiring and or MAX232
-    Modified 2018-02-14 revA by Troy
-        - IMU tested and working correctly
-        - Data logging on SD card and MBED working simultaneously
-        - State Machine is being used to transmit data over Xbee instead of a separate ticker
-        - Servo driver tested separately in FSG_servo_test program (verified servo works separately) 
-        - Electrical issue with PWM signal interfering with motor driver signal (disabled servo for now)
-        - Ability to erase MBED (only the MBED) log file through keyboard console
-    Modified 2018-02-15 revA by Troy
-        - Made minor changes including cleaning up some functions
-    Modified 2018-02-15 revB by Troy
-        - Modified StateMachine class to include manual motor-driving mode and FSM-driven battery and buoyancy engine motor inner loops (CHECK_TUNING)
-        - Fixed some on-screen printouts in the StateMachine class
-        - Added CHECK_TUNING state to MbedLogger printouts to MBED and SD card
-        - Pool tested code worked with several dives.  Neutral was BCE: 162 mm, BATT: 36 mm with CHECK_TUNING state; FIND_NEUTRAL (auto-tune) produced 161.0 and 34 mm
+    Modified FSG PCB V1_5
+        - Freezes when doing a dive or any timed sequence (commented out SD card references)
+        - commented out sdLogger().appendLogFile(current_state, 0);     //open SD file once
+        - commented out sdLogger().appendLogFile(current_state, 1);    //writing data
+        - commented out sdLogger().appendLogFile(current_state, 0);    //close log file
+        - reduced timer to 20 seconds for bench testing
+        - modified ConfigFileIO for rudder()
+        - added in getFloatUserInput function from newer code
 */
  
 #include "mbed.h"
@@ -48,7 +24,7 @@
 
 void setup() {
     pc().baud(57600);
-    pc().printf("\n\n\rFSG POOL TEST 2017-02-15 revB\n\n\r");
+    pc().printf("\n\n\rFSG PCB V1.5 2018-06-06 \n\n\r");
 
 /*    //setup data logger baud rate and write the start of the program (every time you reset)
     datalogger().baud(57600);
@@ -155,7 +131,7 @@
             else if(current_state != 0) {
                 if (!file_opened) {                                 //if the log file is not open, open it
                     mbedLogger().appendLogFile(current_state, 0);   //open MBED file once
-                    sdLogger().appendLogFile(current_state, 0);     //open SD file once
+//                    sdLogger().appendLogFile(current_state, 0);     //open SD file once
                                
                     file_opened = true;                             //stops it from continuing to open it
 
@@ -164,7 +140,7 @@
                 
                 //record to Mbed file system     
                 mbedLogger().appendLogFile(current_state, 1);    //writing data
-                sdLogger().appendLogFile(current_state, 1);    //writing data
+//                sdLogger().appendLogFile(current_state, 1);    //writing data
             }
             
             //when the current FSM state is zero, reset the file
@@ -172,7 +148,7 @@
                 //this can only happen once
                 if (file_opened) {
                     mbedLogger().appendLogFile(current_state, 0);    //close log file
-                    sdLogger().appendLogFile(current_state, 0);    //close log file
+//                    sdLogger().appendLogFile(current_state, 0);    //close log file
                     
                     file_opened = false;