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
Diff: EngineCoolantTemperature.cpp
- Revision:
- 5:0b229ba8ede5
- Child:
- 6:506b703a8acf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/EngineCoolantTemperature.cpp Sun Apr 27 19:13:35 2014 +0000
@@ -0,0 +1,22 @@
+#include "EngineCoolantTemperature.h"
+
+EngineCoolantTemp::EngineCoolantTemp()
+: PidValue("Engine Coolant Temperature", "deg C")
+{
+}
+
+bool EngineCoolantTemp::decode(const uint8_t* data, uint16_t length)
+{
+ if (length < 2)
+ {
+ return false;
+ }
+
+ if ((data[1] != 0x05) || length != 3)
+ {
+ return false;
+ }
+
+ m_value = data[2] - 40; // degree celcius
+ return true;
+}