Michael Ling / ExoController

Dependents:   Data-Management-Honka

Revision:
5:92659a4c2f89
Parent:
4:7e3bbf896e78
Child:
6:721f5e8a794d
diff -r 7e3bbf896e78 -r 92659a4c2f89 BluetoothComm.cpp
--- a/BluetoothComm.cpp	Fri Feb 06 21:16:31 2015 +0000
+++ b/BluetoothComm.cpp	Sat Feb 14 00:37:05 2015 +0000
@@ -1,7 +1,7 @@
 #include "mbed.h"
 #include "MODSERIAL.h"
 #include "BluetoothComm.h"
-#include "init.h"
+#include "initDatabed.h"
 #include <string>
 #include <map>
 //Variable indices for set_values: set_values should take an array of length NUMVARS + NUMREADONLYPARAMS = 34. 
@@ -14,8 +14,10 @@
 //30 = Knee Full Retract, 31 = Knee Full Extend, 32 = Lock Time, 33 = Rate
 BluetoothComm::BluetoothComm(PinName tx, PinName rx): _rn42(tx, rx), _len(0), _counter(0), _inMsg(false), _numVars(22), _numReadOnlyParams(12), _escapesNeeded(8)
 {
+    
+    
     _rn42.baud(9600);
-    printf("Started BTComm init \r\n");
+    pc.printf("Started BTComm init \r\n");
   //  _rn42.baud(115200);
     int temp1[] = {0,1,2,3,4,8,9,10, -1};
   
@@ -36,7 +38,7 @@
     
  
     write_params_to_sd_card();
-    printf("Initialized PARAM \r\n");
+    pc.printf("Initialized PARAM \r\n");
     int temp4[] = {0x01fe, 0x02ac, 0x02ff, 0x0180, 0x0012, 0x0010, 0x0020, 0x00bf, 0x023f, 0x0123, 0x03a2, 0x10};
     readData.write(_numReadOnlyParams, temp4);
     for (int k = 0; k < _numReadOnlyParams; k += 1) {
@@ -47,7 +49,7 @@
     //printf("Initialized data\r\n");
     //Fill the parameter map with data from SD card
     read_data_from_sd();
-    printf("Test: %x\r\n", _paramMap["TorsoAng"]);
+    pc.printf("Test: %x\r\n", _paramMap["TorsoAng"]);
     read_params_from_sd();
  
 
@@ -64,9 +66,9 @@
     int *arr = readData.read(_numReadOnlyParams, arr);
     for (int i = 0; i < _numReadOnlyParams; i += 1) {
         _paramMap[_indexMap[i + _numVars]] = arr[i];
-        printf("Read: %x\r\n", arr[i]);
+       // printf("Read: %x\r\n", arr[i]);
     }
-    printf("Finished reading data\r\n");
+  //  printf("Finished reading data\r\n");
 }
 
 /**
@@ -80,7 +82,7 @@
     for (int i = 0; i < _numVars; i += 1) {
         _paramMap[_indexMap[i]] = arr[i];
     }
-    //printf("Finished reading params\r\n");
+    printf("Finished reading params\r\n");
 }   
 
 /**