Skip to content
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

read Speed #57

Open
cuongcoco opened this issue Aug 10, 2018 · 1 comment
Open

read Speed #57

cuongcoco opened this issue Aug 10, 2018 · 1 comment

Comments

@cuongcoco
Copy link

hi
i want read speed by obdIIUART and print it to Serial monitor
my code is
#include <OBD2UART.h>

COBD obd;

void setup()
{
// we'll use the debug LED as output
pinMode(13, OUTPUT);
Serial.begin(115200);
// start serial communication
obd.begin();
// initiate OBD-II connection until success
while (!obd.init());
}

void loop()
{
int SPEED;
if (obd.readPID(PID_SPPED, SPEED)) {

Serial.println(SPEED);

}
delay(500);
}

but my result is
ATIATZATE0ATH0010D0100012001400160
010D50
010D50
010D50
why it happend? i only want "50" as speed
please help me

@ivanpajon
Copy link

Hi, I think your error can be that you have mispelled PID's name, you need to write PID_SPEED instead of PID_SPPED, so wrong code would see like:

if (obd.readPID(PID_SPEED, SPEED)) {
    Serial.println(SPEED);
}

I hope this can help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants