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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers PidValue.cpp Source File

PidValue.cpp

00001 #include "PidValue.h"
00002 #include "DebugPrint.h"
00003 
00004 PidValue::PidValue(const char* name, const char* unit)
00005 : m_value(0)
00006 , m_unit(unit)
00007 , m_name(name)
00008 {
00009 }
00010 
00011 void PidValue::print()
00012 {
00013     pc.printf("%d %s\r\n", m_value, m_unit);
00014 }
00015 
00016 const char* PidValue::getName()
00017 {
00018     return m_name;
00019 }
00020 
00021 const char* PidValue::getUnit()
00022 {
00023     return m_unit;
00024 }
00025 unsigned int PidValue::getValue()
00026 {
00027     return m_value;
00028 }