Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Adafruit_GFX MODSERIAL mbed-rtos mbed
EngineRpm.cpp
00001 #include "EngineRpm.h" 00002 00003 const char EngineRpm::REQUEST_DATA[8] = {0x02, 0x01, 0x0C, 0, 0, 0, 0, 0}; 00004 00005 EngineRpm::EngineRpm() 00006 : PidValue("Engine RPM", "rpm") 00007 { 00008 } 00009 00010 bool EngineRpm::decode(const uint8_t* data, uint16_t length) 00011 { 00012 if (length < 2) 00013 { 00014 return false; 00015 } 00016 00017 if ((data[1] != 0x0C) || length != 4) 00018 { 00019 return false; 00020 } 00021 00022 m_value = ((data[2] << 8) | data[3]) >> 2; //rpm 00023 return true; 00024 }
Generated on Tue Jul 12 2022 21:25:01 by
1.7.2