I'm having issues initializing the OBD-II adapter that I just received. I don't have a display so I couldn't use one of the example sketches included with the library. I am running the code below and I only see the "About to start" message and then the "Ugh!!!" message repeats. The light on Pin13 stays on and never goes off. I've tried it on both I2C connections on my Arduino Mega. I've also tried it on my UNO and my Nano Arduinos. Could someone give me some pointers on how to get my adapter working? I just installed the libraries and have not modified any of the header or cpp files.
//start the serial connection Serial.begin(115200); // we'll use the debug LED as output pinMode(13, OUTPUT); // start communication with OBD-II adapter obd.begin(); Serial.println("About to start"); digitalWrite(13,HIGH); // initiate OBD-II connection until success while (!obd.init()) { Serial.println("Ugh!!!"); }
}
void loop() { Serial.println("You're in the loop!!!"); digitalWrite(13,LOW); int value; // save engine RPM in variable 'value', return true on success if (obd.read(PID_RPM, value)) { // light on LED on Arduino board when the RPM exceeds 3000 digitalWrite(13, value < 3000 ? HIGH : LOW); } }
Same problem here, I have a Model B and it won't connect to the car either, the blue light flashes for a second and then the whole thing hangs in obd.init().
Hardware: OBD-II Model B MPU-9150 Hardware: Arduino Mega 2560 Car: Prius 2014 OBDII Protocol: ISO 15765-4 CAN (11 bit ID,500 Kbaud) Software: rpm_led_i2c.ino (https://github.com/stanleyhuangyc/Ardui ... ed_i2c.ino) Wiring: OBD-II MPU -> SDA/SDL ports in Mega
I tried to manually change the protocol in the header file, still doesn't work...
I had to connect GND from the adapter to the arduino for it to work (see my post for more details). When connecting, lights still flash this way but then they flash every 30 seconds or so when connected.