TOTAL NOVICE NEEDS HELP :)

Inquiry and support for Freematics products
Post Reply
Daleyb93
Posts: 1
Joined: Sun Feb 21, 2016 7:40 pm

TOTAL NOVICE NEEDS HELP :)

Post by Daleyb93 »

Hi Guys & Girls,
I received my OBD-II UART adapter recently and I've been trying to get some very simple information out of it with no luck :(
The first thing I managed to do was get the rpm test LED working, but I've been now trying to read and output the actual RPM to the Serial Monitor on my computer to see if what I'm doing is working... Im having no luck aside from receiving a load of "?? ? ? ?? ?" etc..
I read that using Serial.print() will disrupt the OBD adapter, so how can I possibly receive data to the serial monitor?
If anyone can help me with the code, that would be great, so far i have this..

___________

#include <Arduino.h>
#include <Wire.h>
#include <OBD.h>

COBD obd;

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

void loop()
{
int rpm;
if (obd.read(PID_RPM, rpm)) {
// RPM is successfully read and its value stored in variable 'rpm'
Serial.println(rpm);
}
}
___________

any help would be MUCH appreciated, I'm a total noob and this is holding me back on my ambitions to read PIDs on my car :P
Cheers everyone,
D
stanley
Site Admin
Posts: 1039
Joined: Sat Mar 01, 2014 3:15 am

Re: TOTAL NOVICE NEEDS HELP :)

Post by stanley »

Again, you can't use serial.print when using the UART adapter on UNO. UART means serial.
eraldino
Posts: 3
Joined: Mon Sep 26, 2016 10:21 pm

Re: TOTAL NOVICE NEEDS HELP :)

Post by eraldino »

stanley wrote:Again, you can't use serial.print when using the UART adapter on UNO. UART means serial.


Hello stanley, I see that when using UART adapter the Serial.print will not work on the UNO. Will this work if I use an Arduino Leonardo or Micro? I will put the RX TX of the UART Adaptor in Serial1 of the Leonardo/Micro then I can probably output a Serial data?
eraldino
Posts: 3
Joined: Mon Sep 26, 2016 10:21 pm

Re: TOTAL NOVICE NEEDS HELP :)

Post by eraldino »

Hey stanley if I use a mega where do i connect the RX TX of the OBD-II Adaptor?
stanley
Site Admin
Posts: 1039
Joined: Sat Mar 01, 2014 3:15 am

Re: TOTAL NOVICE NEEDS HELP :)

Post by stanley »

Connect to Rx1 and Tx1 on Arduino MEGA.
Post Reply