all bms comunicating with nucleo board and balancing
Fork of Can_sniffer_BMS_GER by
Diff: main.cpp
- Revision:
- 39:90a56ddcdf4a
- Parent:
- 38:3e01f81f0808
- Child:
- 40:54d07c794d87
diff -r 3e01f81f0808 -r 90a56ddcdf4a main.cpp --- a/main.cpp Wed Nov 09 21:44:12 2016 +0000 +++ b/main.cpp Thu Nov 10 11:15:45 2016 +0000 @@ -186,9 +186,30 @@ void ctprint(){ int n; + float temp; + float current; + float r; + + + for(n=95; n>=0; n--){ - //printf("cellsv0: %f cvprint\r\n", cellsv[0]); - printf("ntc: %d temperature: %f \r\n", n+1,cellst[n]); + + + temp=cellst[n]/1000; + + r=(temp*10000)/(3.3-temp); + + /* + current=(temp/10000); + r = (3300/current)-10000; + */ + + temp = 3380/log(r/0.119228); + temp = temp-273.15; + + + //printf("celtemplsv0: %f cvprint\r\n", cellsv[0]); + printf("ntc: %d temperature: %f ntc resistance:%f \r\n", n+1,temp,r); } printf("\r\n""""""""""""""""""""""""""""""""""""""""""""""""\r\n"); } @@ -249,11 +270,8 @@ */ // Filtering performed by software: }else if((rxMsg.id==21)||(rxMsg.id==22)||(rxMsg.id==23)){ - //printf("olaola\r\n"); // cellst[(rxMsg.id-21)*32+rxMsg.data[4]-1]=data.f[0]; - printf("OLA"); - data.bytes[0] = rxMsg.data[0]; data.bytes[1] = rxMsg.data[1]; data.bytes[2] = rxMsg.data[2];