Ultima versão da banca de ensaios BMS Fev2017
Dependencies: CANnucleo LTC68041 mbed
Fork of BMS_4 by
Diff: main.cpp
- Revision:
- 43:cf574cc8b74f
- Parent:
- 42:ca364a2bf162
- Child:
- 44:51fadd7414b1
--- a/main.cpp Thu Nov 10 11:15:35 2016 +0000 +++ b/main.cpp Fri Nov 25 23:26:58 2016 +0000 @@ -268,7 +268,7 @@ } */ - +float temp; void check_temperatures() { for (int i=0; i<32; i++){ @@ -344,6 +344,13 @@ }else{ temp_codes[i] = MUXB_Read.read()*3300; } + + //-------------------------- + temp=temp_codes[i]/1000; + temp=(temp*10000)/(3.3-temp); + temp = 3380/log(temp/0.119228); + temp_codes[i] = temp-273.15; + //-------------------------- } temps_left = 32; } @@ -459,7 +466,7 @@ if(temps_left>0){ txMsg.clear(); - txMsg.id = 23; //BMS1=>ID:11; BMS2=>ID:12; BMS3=>ID:13. + txMsg.id = 23; //BMS1=>ID:21; BMS2=>ID:22; BMS3=>ID:23. txMsg.len = 5; data.f[0] = temp_codes[temps_left-1];