Hello?
I'm using adapter v2.0 with software Serial.
I plugged adapter's white line to my arduino UNO pin3, and green line to pin2.
I plugged adapter to OBD2 port but It seems nothing happened to my laptop serial monitor.
Is there any error with my code?
#include <OBD2UART.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);
COBD obd;
void readPIDSingle()
{
int value;
if (obd.readPID(PID_RPM, value)) {
mySerial.print(value);
Serial.print(value);
}
mySerial.println();
Serial.println();
}
void setup()
{
mySerial.begin(115200);
while (!mySerial);
obd.begin();
// initialize OBD-II adapter
do {
mySerial.println("Connecting...");
Serial.println("Connecting...");
} while (!obd.init());
mySerial.println("OBD connected!");
Serial.println("OBD connected!");
}
void loop()
{
readPIDSingle();
}
adapter V2.0 with software serial.
Re: adapter V2.0 with software serial.
Be aware software serial is never stable above 38400bps on ATmega328.