Go Down

Topic: Serials... (Read 480 times) previous topic - next topic


Mar 07, 2014, 07:38 pm Last Edit: Mar 07, 2014, 07:41 pm by Slavka85 Reason: 1

   Hi guys.. Im new to arduino world. So pls help...

I got this problem here:

    I try to use 3 serials not really at the same time but .  I got 3 Serials.. UNO serial hookuped with OBD-UART, Blue.serial with bluetooth device... LCD.serial is LSD skreen... All staff from sparkfun.... All bound rates at 9600. Bluetooth UNO LCD OBD_UART
    So what happens is that if i  send chareters from bluetooth to serial or lcd it comes with mistakes or not all word like for example: bluetooth i will get on lcd or serial like: uetooth. And if send just one char it missing each secon or therd time... Like it wont read the first few char on bigining of the word... And it's bidirectional no matter from lcd or serial i send to blue Watever..

This the code:

Code: [Select]
#include <SoftwareSerial.h>

SoftwareSerial lcd(2,3);
SoftwareSerial blue(4,5);\\

void setup()
 lcd.print("LCD Start");
 blue.print("Blue Start");

 Serial.print("Serial Start");


void loop()
 else if(Serial.available()>0, Serial.read()=='l')     //This is command char to clear lcd... That's what im all time missing

void clearDisplay()
 lcd.write(0xFE);  // send the special command
 lcd.write(0x01);  // send the clear screen command




Code: [Select]
if(Serial.available()>0, Serial.read()=='l') ?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.


This my cpesial char to obtain the clear lcd function..

It just the beggining of the code. but it is already gives a problem... this char missing evry second or therd time you sending it... like you need send 3 l. then it clean it the lcd.


Get yourself an Arduino Mega,  which has four serial interfaces.


Mar 11, 2014, 06:28 am Last Edit: Mar 11, 2014, 06:44 am by Slavka85 Reason: 1
 Ok. I got myself Mega...

And its unbelivable what happens on this serials ... What im trying to do atleast for now is a pathway for data...
on serial1 here is obd_uart.  on serial 2  out in loop section i puting in there or blutoth or lcd... And here happans some kind of debounsing ... on port 2 instade of any data i getting ??????????????????????????? unSTOPable.....  it's stops only if i unplug  tx wire from serial2.... I understand if it happans when all devices has difrent ground... All devicecs Mega OBD_UART bluetooth and lcd all on one ground.... CRAZY DEBOUNS.  i tryed put Tx through resistor on the ground - same shit. I don't know what to do else...

What bord broken??? Could Be?.... But it  prints the "blue poehali" and then when loops starts just unstopable ??????????????????????????? and so on.... AHHHHHH

So to be more clear... On setup The OBD_UART gets right comands and do them and it prints the answer which doesn't wanna go at all through the bord   ( debounsing)

On loop you not putting anything you just getting(?????????????????????????????????????????????????)

Code: [Select]

int vehicleSpeed = 0;
int vehicleRPM = 0;

void setup()
 Serial1.begin(9600);  //This serial for OBD-UART
 //Wait for a little while before sending the reset command to the OBD-II-UART
 //Reset the OBD-II-UART
     // Print answer from ELM on ATz
 //Wait for a bit before starting to send commands after the reset.
 Serial1.print("ATE0\r");  //turn echo of
   char inByte = Serial1.read();   // Print answer from ELM

void loop(){


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131