Start a new topic

Problem with serial ports

I have a gps, arduino MEGA and 7' enhanced model, I want to display the coordinates but im having problems.

For separate I can communicate with the screen and I get the coordinates but when I connect both, gps cant find the coordinates.

Im using the nextion.h library, only with gps I obtain:

 

recvRetCommandFinished err
lat=38.11

 So I connect screen:

I have the gps in Tx1-Rx1 and screen Tx2-Rx2. I don't know if can be for serial ports. 

void setup(void){
    
    nexInit();
    Serial1.begin(4800);    //gps
}

 


(I cant edit)

So I connect screen:

recvRetCommandFinished ok
lat=0.00 

  

I am not the Arduino guru - but an observer of many posts on here.


Many cases when using two serials on the Mega, many of the users are using the hardware serial for one device and the a software serial library for the Nextion device.  There certainly is plenty of posts in the Free Chat section in trying to deal with the two serial port problems.

You mean use <softwareSerial.h> library?

Could you write a simple example? Im totally lost and cant find the post u said, neither on arduino forums.

Mario


Sorry, I code in pascal.  I am not the Arduino guru.

Login or Signup to post a comment