Small project to display some OBD values from the Toyota GT86/ Subaru BRZ/ Scion FRS on an OLED display.
Dependencies: Adafruit_GFX MODSERIAL mbed-rtos mbed
PidValue.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 "PidValue.h" |
chrta | 5:0b229ba8ede5 | 2 | #include "DebugPrint.h" |
chrta | 5:0b229ba8ede5 | 3 | |
chrta | 5:0b229ba8ede5 | 4 | PidValue::PidValue(const char* name, const char* unit) |
chrta | 5:0b229ba8ede5 | 5 | : m_value(0) |
chrta | 5:0b229ba8ede5 | 6 | , m_unit(unit) |
chrta | 5:0b229ba8ede5 | 7 | , m_name(name) |
chrta | 5:0b229ba8ede5 | 8 | { |
chrta | 5:0b229ba8ede5 | 9 | } |
chrta | 5:0b229ba8ede5 | 10 | |
chrta | 5:0b229ba8ede5 | 11 | void PidValue::print() |
chrta | 5:0b229ba8ede5 | 12 | { |
chrta | 5:0b229ba8ede5 | 13 | pc.printf("%d %s\r\n", m_value, m_unit); |
chrta | 5:0b229ba8ede5 | 14 | } |
chrta | 5:0b229ba8ede5 | 15 | |
chrta | 5:0b229ba8ede5 | 16 | const char* PidValue::getName() |
chrta | 5:0b229ba8ede5 | 17 | { |
chrta | 5:0b229ba8ede5 | 18 | return m_name; |
chrta | 6:506b703a8acf | 19 | } |
chrta | 6:506b703a8acf | 20 | |
chrta | 6:506b703a8acf | 21 | const char* PidValue::getUnit() |
chrta | 6:506b703a8acf | 22 | { |
chrta | 6:506b703a8acf | 23 | return m_unit; |
chrta | 6:506b703a8acf | 24 | } |
chrta | 6:506b703a8acf | 25 | unsigned int PidValue::getValue() |
chrta | 6:506b703a8acf | 26 | { |
chrta | 6:506b703a8acf | 27 | return m_value; |
chrta | 5:0b229ba8ede5 | 28 | } |