Cell voltages fork (SoC)

Dependencies:   CUER_CAN CUER_DS1820 LTC2943 LTC6804 mbed PowerControl

Revision:
21:d461d58e70fc
Parent:
20:a1a1bfc938da
Child:
22:2df45c818786
Child:
23:a1af4439c1fc
--- a/main.cpp	Sun Jul 02 17:00:44 2017 +0000
+++ b/main.cpp	Tue Jul 04 20:36:29 2017 +0000
@@ -56,8 +56,6 @@
     uint16_t volt_readings[36];
     int can_ids[9];
     
-    DigitalOut isotherm_12V_pin(ISOTHERM_12V_PIN); //Sets Temperature Pin
-    isotherm_12V_pin = 1;
     init();
     
     //current_EEPROM_address = read_EEPROM_startup(measurements); // Read from the eeprom at startup to fill in the values of SoC
@@ -116,16 +114,13 @@
         msg = createVoltageTelemetry(repeating_unit_length*i+2, measurements.cell_voltages[i].voltages); 
         can.write(msg);
         printf("Voltage Message id: %d \r\n", msg.id);
-        wait(0.1);
         //+4 - 4 cell voltages sent per measurement, simple pointer arithmetic
         msg = createVoltageTelemetry(repeating_unit_length*i+3, measurements.cell_voltages[i].voltages + 4); 
         can.write(msg);
         printf("Voltage Message id: %d \r\n", msg.id);
-        wait(0.1);
         msg = createVoltageTelemetry(repeating_unit_length*i+4, measurements.cell_voltages[i].voltages + 8); 
         can.write(msg);
         printf("Voltage Message id: %d \r\n", msg.id);
-        wait(0.1);
     }
     
     printf("Devices found %d \r\n", devices_found);
@@ -139,7 +134,6 @@
         if(can.write(msg));
         else
             printf("Sending Temperature Failed for some reason");
-        wait(0.1);
     }
 
     // Create SOC CAN message
@@ -226,8 +220,9 @@
 {
     float min_temperature;
     float max_temperature;
+    isotherm_12V_pin = 1;
     probe[0]->convert_temperature(DS1820::all_devices);
-    //isotherm_12V_pin = 0;
+    
     min_temperature = probe[0]->temperature('C');
     max_temperature = min_temperature; // Initially set the max and min temperature equal
     printf("Devices found in temp readings: %d", devices_found);
@@ -246,7 +241,7 @@
         
         //printf("Device %d temperature is %3.3f degrees Celcius.\r\n",i+1 ,probe[i]->temperature('C'));
     }
-    
+    isotherm_12V_pin = 0;
     //There is also a CMU # component of this struct, currently unfilled, perhaps not needed at all.
     measurements.max_cell_temp.temperature = max_temperature;
     measurements.min_cell_temp.temperature = min_temperature;