Ultima versão da banca de ensaios BMS Fev2017

Dependencies:   CANnucleo LTC68041 mbed

Fork of BMS_4 by Gerardo Antonio

Revision:
49:94a58ef0edc4
Parent:
48:ddb7570eb4d7
Child:
50:3cc0ad385612
--- a/main.cpp	Tue Dec 06 11:45:41 2016 +0000
+++ b/main.cpp	Wed Dec 07 08:55:29 2016 +0000
@@ -166,7 +166,7 @@
     cells_left = 12;
     for (int current_ic = 0 ; current_ic < TOTAL_IC; current_ic++) {
         for (int i=0; i<12; i++) {
-            if(cell_codes[current_ic][i]*0.0001  > 4.1) {   //liga balanceamento
+            if(cell_codes[current_ic][i]*0.0001  > 4.07) {   //liga balanceamento
                 switch (i) {
                     case 0: //cell 1
                         tx_cfg[0][4] = tx_cfg[0][4] | 0x01 ;    // 00000001
@@ -409,7 +409,7 @@
     to_charge_or_not_to_charge=0;
     charging = 0;
     discharging = 1;
-    ticker.attach(&monitor, 10);
+    ticker.attach(&monitor, 3);
     LTC6804_initialize();
     init_cfg();
 //write configuration
@@ -496,7 +496,7 @@
 if(temps_left==1||temps_left==2||temps_left==3||temps_left==4||temps_left==5||
 temps_left==6||temps_left==7||temps_left==8||temps_left==9||temps_left==10||
 temps_left==11||temps_left==12||temps_left==15||temps_left==31){
-       if(temp_codes[temps_left-1]>65||temp_codes[temps_left-1]<4){   //4-49(ambiente)
+       if(temp_codes[temps_left-1]>65||temp_codes[temps_left-1]<-20){   //4-49(ambiente)
      //if(temp_codes[temps_left-1]>25||temp_codes[temps_left-1]<-300){   //for debug
        // if(temp_codes[i]>30||temp_codes[i]<-20){
         __disable_irq();    // Disable Interrupts