Here is my code, am I doing something wrong? I tried the original datalogger code, I got the OBD: FAIL on it also. By the way, I tried with specifying the protocol in init() function, and without it. Both returns false.
Code: Select all
#include <FreematicsONE.h>
COBDSPI obd;
bool connected = false;
int value;
void setup()
{
Serial.begin(115200);
while(!obd.begin()) Serial.println("Failed to begin");
Serial.println("OBD init.");
while (!connected) {
Serial.print("Connecting to OBD...");
if (obd.init(PROTO_CAN_11B_500K)) {
Serial.println("OK");
connected = true;
} else {
Serial.println("Failed to connect to OBD.");
}
}
}
void loop()
{
delay(5000);
}