- Fri Dec 27, 2013 9:08 pm
#5487
Hi Stanley,
Great foundation for new projects and I got your data logger kit #3 to try it out. I can't get it to communicate with my car at all. In fact I get identical results if the ODB2 adapter is plugged into my car or not.
The LCD says "Initializing..." and then a few seconds later it says "Coolant Temp: 0" regardless if the adapter is plugged into my car or not.
Here is the most basic sketch I'm trying to do just to read something from my car.
[code]#include <Arduino.h>
#include <Wire.h>
#include <OBD.h>
#include <MultiLCD.h>
LCD_ILI9325D lcd; // for Itead 2.8" TFT shield
COBDI2C obd;
int value = 0;
void setup()
{
lcd.begin();
lcd.setCursor(0,6);
lcd.print("Initializing... ");
// start communication with OBD-II UART adapter
obd.begin();
// initiate OBD-II connection until success
while (!obd.init());
}
void loop()
{
obd.read(PID_COOLANT_TEMP, value);
lcd.setCursor(0,6);
lcd.print("Coolant Temp: ");
lcd.printInt(value);
}[/code]
Any pointers on why it would not be communicating with my car? The adapter is plugged into the mega sensor shield through the I2C port and is correctly oriented as it powers up the board and LCD from the ODBII port and I've also tried powering it up through the USB port too. Key is turned to the on position in the car. It's a 2003 Ford Mustang Cobra if it makes any difference.
Thanks
Great foundation for new projects and I got your data logger kit #3 to try it out. I can't get it to communicate with my car at all. In fact I get identical results if the ODB2 adapter is plugged into my car or not.
The LCD says "Initializing..." and then a few seconds later it says "Coolant Temp: 0" regardless if the adapter is plugged into my car or not.
Here is the most basic sketch I'm trying to do just to read something from my car.
[code]#include <Arduino.h>
#include <Wire.h>
#include <OBD.h>
#include <MultiLCD.h>
LCD_ILI9325D lcd; // for Itead 2.8" TFT shield
COBDI2C obd;
int value = 0;
void setup()
{
lcd.begin();
lcd.setCursor(0,6);
lcd.print("Initializing... ");
// start communication with OBD-II UART adapter
obd.begin();
// initiate OBD-II connection until success
while (!obd.init());
}
void loop()
{
obd.read(PID_COOLANT_TEMP, value);
lcd.setCursor(0,6);
lcd.print("Coolant Temp: ");
lcd.printInt(value);
}[/code]
Any pointers on why it would not be communicating with my car? The adapter is plugged into the mega sensor shield through the I2C port and is correctly oriented as it powers up the board and LCD from the ODBII port and I've also tried powering it up through the USB port too. Key is turned to the on position in the car. It's a 2003 Ford Mustang Cobra if it makes any difference.
Thanks