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@7:a19b63c0a0fa, 2014-05-11 (annotated)
- Committer:
- chrta
- Date:
- Sun May 11 09:05:37 2014 +0000
- Revision:
- 7:a19b63c0a0fa
- Parent:
- 6:506b703a8acf
Changed Adafruit_GFX to my own fork.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| chrta | 5:0b229ba8ede5 | 1 | #include "EngineCoolantTemperature.h" |
| chrta | 5:0b229ba8ede5 | 2 | |
| chrta | 6:506b703a8acf | 3 | const char EngineCoolantTemp::REQUEST_DATA[8] = {0x02, 0x01, 0x05, 0, 0, 0, 0, 0}; |
| chrta | 6:506b703a8acf | 4 | |
| chrta | 5:0b229ba8ede5 | 5 | EngineCoolantTemp::EngineCoolantTemp() |
| chrta | 6:506b703a8acf | 6 | : PidValue("Coolant Temp", "C") |
| chrta | 5:0b229ba8ede5 | 7 | { |
| chrta | 5:0b229ba8ede5 | 8 | } |
| chrta | 5:0b229ba8ede5 | 9 | |
| chrta | 5:0b229ba8ede5 | 10 | bool EngineCoolantTemp::decode(const uint8_t* data, uint16_t length) |
| chrta | 5:0b229ba8ede5 | 11 | { |
| chrta | 5:0b229ba8ede5 | 12 | if (length < 2) |
| chrta | 5:0b229ba8ede5 | 13 | { |
| chrta | 5:0b229ba8ede5 | 14 | return false; |
| chrta | 5:0b229ba8ede5 | 15 | } |
| chrta | 5:0b229ba8ede5 | 16 | |
| chrta | 5:0b229ba8ede5 | 17 | if ((data[1] != 0x05) || length != 3) |
| chrta | 5:0b229ba8ede5 | 18 | { |
| chrta | 5:0b229ba8ede5 | 19 | return false; |
| chrta | 5:0b229ba8ede5 | 20 | } |
| chrta | 5:0b229ba8ede5 | 21 | |
| chrta | 5:0b229ba8ede5 | 22 | m_value = data[2] - 40; // degree celcius |
| chrta | 5:0b229ba8ede5 | 23 | return true; |
| chrta | 5:0b229ba8ede5 | 24 | } |