Here is my code:
I modified it a bit to display the data in the serial monitor.
Code: Select all
/*************************************************************************
* Sample sketch based on OBD-II library for Arduino
* Distributed under GPL v2.0
* Visit http://freematics.com for more information
* (C)2012-2014 Stanley Huang <stanleyhuangyc@gmail.com>
*************************************************************************/
#include <OBD2UART.h>
COBD obd;
void setup()
{
Serial.begin(9600);
// we'll use the debug LED as output
pinMode(13, OUTPUT);
// start communication with OBD-II UART adapter
obd.begin();
// initiate OBD-II connection until success
while (!obd.init());
}
void loop()
{
int value;
if (obd.readPID(PID_RPM, value)) {
// RPM is successfully read and its value stored in variable 'value'
// light on LED when RPM exceeds 3000
digitalWrite(13, value > 3000 ? HIGH : LOW);
Serial.println(value);
}
}
http://imgur.com/a/2IlpN
I am using an Arduino UNO R3 and I'm trying to display the RPM data stored in "value" into the serial monitor attached here in this post is the screen shot of my Serial Monitor feed.
You can see that it's displaying weird data. This usually happens when there is a problem in the baudrate (in my experience) but i want to know first hand from the support team what I must do.
My real goal is to display all data in serial monitor and pass it on using Bluetooth,Serial,WIFI etc etc.