Well, I never got past a few tests.
I was using some test code which simply requests RPM when a button is pressed. It also uses my serial LCD using the software serial library.
Before I experienced some hardware problems, I could send ELM specific commands and receive the output but, the OBD commands would result in "BUS INIT:...>" with no error or anything but then the next command would do the same thing.
Code:
#include <SoftwareSerial.h>
#define rxPin 2
#define txPin 3
#define fButtonPin 4
#define keyWait 200
SoftwareSerial LCD = SoftwareSerial(rxPin, txPin);
void setup() {
// define pin modes for tx, rx, led pins:
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
// start serial connections
LCD.begin(9600);
Serial.begin(9600);
// setup button and turn on the internal pull-up resistor
pinMode(fButtonPin, INPUT);
digitalWrite(fButtonPin, HIGH);
// set ELM to formated data
Serial.println("ATFD");
// turn off command echo
Serial.println("ATE0");
LCD.print("?a?fELM OUT:?n");
// reset the ELM
Serial.println("ATZ");
}
void loop() {
char temp;
// if there is something waiting on the serial connection, get that and send to LCD
while(Serial.available()) {
temp = Serial.read();
LCD.print(temp);
}
// if the front button was pressed, send the ELM command
if(digitalRead(fButtonPin) == LOW) {
delay(keyWait);
LCD.print("?a?f"); // clear the LCD and reset cursor
Serial.println("010c"); // ask for the engine RPM
}
}