I found a diff with the rpm_led demo - it's probably the initialization
const uint8_t chipSelect = SS;
unsigned long lastTick = millis();
SdFat sd;
COBD obd;
int rpm;
int speed_;
int throttle;
int eng_load;
int abs_eng_load;
int fuel;
int dist;
void setup() {
Serial.begin(OBD_SERIAL_BAUDRATE);
sd.begin(chipSelect, SPI_FULL_SPEED);
while (!obd.Init()); // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< change this line this is from the example program
}
//------------------------------------------------------------------------------
void loop() {
unsigned long curTick = millis();
if (curTick - lastTick > 500)
{
ofstream sdlog("LOGFILE.TXT", ios::out | ios::app);
obd.ReadSensor(PID_RPM, rpm);
obd.ReadSensor(PID_SPEED, predk);
obd.ReadSensor(PID_THROTTLE, przepustnica);
obd.ReadSensor(PID_ENGINE_LOAD, eng_load);
obd.ReadSensor(PID_ABS_ENGINE_LOAD, abs_eng_load);
obd.ReadSensor(PID_FUEL_LEVEL, fuel);
obd.ReadSensor(PID_DISTANCE, dist);
sdlog << "PID_RPM: " << rpm << ";PID_SPEED: " << predk << ";PID_THROTTLE: " << przepustnica << ";PID_ENGINE_LOAD: " << eng_load << ";PID_ABS_ENGINE_LOAD: " << abs_eng_load << ";PID_FUEL_LEVEL: " << fuel << ";PID_DISTANCE: " << dist << endl;
// if (!sdlog) sd.errorHalt("append failed");
lastTick = curTick;
}
}