Dual CANbus monitor and instrumentation cluster supporting ILI9341 display controller
Dependencies: SPI_TFTx2_ILI9341 TOUCH_TFTx2_ILI9341 TFT_fonts mbed
Fork of CANary by
Diff: main.cpp
- Revision:
- 174:cd27e80f197d
- Parent:
- 173:9815b1467039
- Child:
- 175:0357b4159b40
diff -r 9815b1467039 -r cd27e80f197d main.cpp --- a/main.cpp Sun Dec 29 22:35:09 2013 +0000 +++ b/main.cpp Sun Jan 05 05:02:41 2014 +0000 @@ -11,8 +11,8 @@ // * Add climate control impact to main max/min dte and new trip display // * Be more efficient with write buffer (use msgLen instead of always storing 8 bytes) -// rev173 -// fixed bugs +// rev174 +// Calibrated brake monitor. brkMonRate 378947 --> 1 chirp per 4Wh #include "mbed.h" #include "CAN.h" @@ -23,7 +23,7 @@ #include "displayModes.h" #include "TOUCH_TFTx2.h" -char revStr[7] = "173"; +char revStr[7] = "174"; unsigned long maxTarget = 1000; FATFS USBdrive; LocalFileSystem local("local"); @@ -130,7 +130,7 @@ bool step = false; char header[5]; char data[8]; -signed long motorRPM_x2; +signed long motorRPM; unsigned char skin = ttSkin ; unsigned char dtePeriod = 14; //ten minute averaging interval float CCkWh_trip[3]={0}; @@ -921,7 +921,7 @@ // 227 would give more accurate mph for MXV4s@40psi - 11.75" distance from center of tire to pavement // but then efficiency estimation would not track miles driven as read from the odometer so // making CANary have the same error as the Leaf instrumentation - mph[0]=((float) motorRPM_x2)/numSsamples/220; + mph[0]=((float) motorRPM)/numSsamples/110; } else { mph[0]=0; } @@ -978,7 +978,7 @@ CCkWh_trip[1]=0; } - motorRPM_x2=0; + motorRPM=0; mWs_x4=0; // Compute ESR