-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set a special pisd of ELMDUINO with header #219
Comments
The loop above is not using the library correctly, it should be like this: void loop()
{
myELM327.queryPID("2218E4");
if (myELM327.nb_rx_state == ELM_SUCCESS)
{
read_rawdata();
//BATTv = ((convertToInt(dataFrame2, 4, 5)<<8) + convertToInt(dataFrame2, 6, 7))/10;
int A=convertToInt(dataFrame2, 4, 5);
int B=convertToInt(dataFrame2, 6, 7);
BATTv =((A*256)+B)*(1000/65535);
Serial.print("intasamento: ");
Serial.println(BATTv);
Serial.print(" % ");
delay(1000);
clearData();
}
else if (myELM327.nb_rx_state != ELM_GETTING_MSG)
{
myELM327.printError();
}
} And this code should go into setup(): myELM327.sendCommand("AT SH DA10F1"); // Set Header BMS |
thanks for the advice, I updated as you said and after sending the command in the setup I put a Serial.print but nothing is printed in the serial monitor, in my opinion it stops in that function |
OK, I didn't look closely at that code before, but I don't see anywhere that myELM327.begin() is called. It should probably be in the setup() method. Can you link to the original code? |
what I wrote is exactly the same as the original, I just changed the pids and the header |
Hmm, I can't see how that could have ever worked.... Try adding this code in setup() before the sendCommand() instruction: if (!myELM327.begin(mySerial, true))
{
Serial.println(F("Couldn't connect to OBD scanner - Phase 2"));
while (1)
;
} Also, have you verified that the pin numbers specified for mySerial() are correct for your hardware? |
I added this line of code but the program stops at that if you made me add and I don't understand why. the OBD I use has a reception LED that lights up when it receives a command and lights up when I ask for the pin, however in the doubt it gives me the sending message and then clears the buffer without even entering the if that confirms reception |
I saw that someone solved the querypids infinite click bug with processpid so is this correct? myELM327.processPID("ATSH DA10F1","2218E4",8); why does it give this error |
You can't submit commands using Line 321 in 3576084
You can use these functions to send commands: Lines 322 to 323 in 3576084
|
Hello. How to include headers in a loop (myELM327.sendCommand) |
I found this program on the net and I'm trying to modify it to receive from Arduino the clogging of the dpf of my car which is requested via a header "ATSH DA10F1" AND FROM A PIDS 2218E4 ONLY THAT THE program arrives " myELM327.sendCommand("AT SH DA10F1");" and it stops, it no longer goes forward and it doesn't print anything via serial
The text was updated successfully, but these errors were encountered: