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
EngineCoolantTemperature.cpp
00001 #include "EngineCoolantTemperature.h" 00002 00003 const char EngineCoolantTemp::REQUEST_DATA[8] = {0x02, 0x01, 0x05, 0, 0, 0, 0, 0}; 00004 00005 EngineCoolantTemp::EngineCoolantTemp() 00006 : PidValue("Coolant Temp", "C") 00007 { 00008 } 00009 00010 bool EngineCoolantTemp::decode(const uint8_t* data, uint16_t length) 00011 { 00012 if (length < 2) 00013 { 00014 return false; 00015 } 00016 00017 if ((data[1] != 0x05) || length != 3) 00018 { 00019 return false; 00020 } 00021 00022 m_value = data[2] - 40; // degree celcius 00023 return true; 00024 }
Generated on Tue Jul 12 2022 21:25:01 by
1.7.2