Dual CANbus monitor and instrumentation cluster
Dependencies: SPI_TFTx2 TFT_fonts TOUCH_TFTx2 beep mbed
Fork of CANary by
Diff: utility.cpp
- Revision:
- 51:6187c5264a73
- Parent:
- 50:83d5864c64a0
- Child:
- 58:4d06288d75a2
--- a/utility.cpp Sun Apr 07 16:34:12 2013 +0000 +++ b/utility.cpp Sun Apr 07 17:11:28 2013 +0000 @@ -132,6 +132,9 @@ } }else if((mType==1)&&(canRXmsg.id==0x1da)){ //Motor Speed imotorRPM=((canRXmsg.data[4]<<8)|(canRXmsg.data[5])); + if(imotorRPM<0){ // take absolute value + imotorRPM=-imotorRPM; + } motorRPM+=imotorRPM; numSsamples++; }