I just got an OBD library here. I opened an example sketch and tried to upload it but got errors that I do not understand.
code:
/*************************************************************************
* Sample sketch based on OBD-II library for Arduino
* Distributed under GPL v2.0
* Copyright (c) 2012 Stanley Huang <stanleyhuangyc@gmail.com>
* All rights reserved.
*************************************************************************/
#include <OBD.h>
COBD obd;
void setup()
{
// we'll use the debug LED as output
pinMode(13, OUTPUT);
// start serial communication at the adapter defined baudrate
Serial.begin(OBD_SERIAL_BAUDRATE);
// initiate OBD-II connection until success
while (!obd.Init());
}
void loop()
{
int value;
if (obd.ReadSensor(PID_RPM, value)) {
// RPM is read and stored in 'value'
// light on LED when RPM exceeds 5000
digitalWrite(13, value > 5000 ? HIGH : LOW);
}
}
errors:
In file included from rpm_led.cpp:8:
C:\Users\Nick\Documents\Arduino\libraries\OBD/OBD.h:46: error: 'byte' has not been declared
C:\Users\Nick\Documents\Arduino\libraries\OBD/OBD.h:48: error: 'byte' does not name a type
C:\Users\Nick\Documents\Arduino\libraries\OBD/OBD.h:49: error: 'byte' does not name a type
C:\Users\Nick\Documents\Arduino\libraries\OBD/OBD.h:54: error: 'byte' has not been declared
C:\Users\Nick\Documents\Arduino\libraries\OBD/OBD.h:55: error: 'byte' has not been declared
C:\Users\Nick\Documents\Arduino\libraries\OBD/OBD.h:75: error: 'byte' does not name a type
C:\Users\Nick\Documents\Arduino\libraries\OBD/OBD.h: In constructor 'COBD::COBD()':
C:\Users\Nick\Documents\Arduino\libraries\OBD/OBD.h:41: error: 'dataMode' was not declared in this scope
C:\Users\Nick\Documents\Arduino\libraries\OBD/OBD.h:42: error: 'errors' was not declared in this scope
OBD.h is located in "C:\Users\Nick\Documents\Arduino\Libraries\OBD"
I've tried with IDE 1.0 and 1.0.1. What could be causing this?
Thanks