SparkFun Serial Enabled LCD, Scrolling Text

Using an Arduino Uno-R3 and the SparkFun Serial Enabled LCD kit (SparkFun Serial Enabled LCD Kit - LCD-10097 - SparkFun Electronics), I have text being transmitted via an XBee Pro-S1 from another remote Arduino to the Arduino connected to the serial enabled lcd via a receiving XBee Pro-S1.

The LCD is connected to the Arduino via 5V, ground, and the RX is connected to the Arduino's digital pin 3.

The message is being sent to the LCD and is displayed, however since it is rather long, only some of the message is displayed. Is it possible, and if so, how might I have the screen scroll the message so all of it is displayed?

Here is my "transmitter" code (which works great):

#include <SoftwareSerial.h>
#include <TinyGPS.h>

#define RXPIN 2
#define TXPIN 3

#define TERMBAUD  9600

#define GPSBAUD  4800

TinyGPS gps;

SoftwareSerial uart_gps(RXPIN, TXPIN);

void getgps(TinyGPS &gps);

void setup()
{
  Serial.begin(TERMBAUD);
  
  uart_gps.begin(GPSBAUD);
  
  //Serial.println("");
  //Serial.println("GPS Shield QuickStart Example Sketch v12");
 // Serial.println("       ...waiting for lock...           ");
 // Serial.println("");
}

void loop()
{
  while(uart_gps.available())
  {
      int c = uart_gps.read();
      if(gps.encode(c))      
      {
        getgps(gps);        
      }
  }
}

void getgps(TinyGPS &gps)
{
  float latitude, longitude;

  gps.f_get_position(&latitude, &longitude);
  
  if (latitude >= 41.479133 && latitude <= 41.493510 && longitude >= -71.541359 && longitude <= -71.522058)
  {
  Serial.println("Warning, within Airport Flight Safety Zone. Contact local airport of drone flight intentions."); 
  }
}

Here is my "receiver" code which is having issues displaying the message in full (want the long message to scroll to the left so entire thing ends up being displayed):

#include <SoftwareSerial.h>

SoftwareSerial lcd(2,3);

void setup()
{
  Serial.begin(9600);
  lcd.begin(9600);
}

void loop()
{
  while (Serial.available()) 
  {
    lcd.print((char) Serial.read());
  }
}

Thank you for you help!

Here is my "receiver" code which is having issues displaying the message in full (want the long message to scroll to the left so entire thing ends up being displayed):

You are NOT displaying a "full message". You are displaying a series of characters.

You need to collect the data from the XBee, and store that data in an array. Then, you need to display (some of) the data in the array on the LCD (scrolling it however you see fit).

PaulS:
You are NOT displaying a "full message". You are displaying a series of characters.

You need to collect the data from the XBee, and store that data in an array. Then, you need to display (some of) the data in the array on the LCD (scrolling it however you see fit).

When you say I need to display the data in an array, do you mean set up the text as a string?

I have tried looking into this. The strings should be defined in the "transmitter" code, right? Where would I define my message to be sent in the code? In the void loop before my conditional if statement to send data or within the if statement loop?

And then have the "receiver" code print the strings using something like

for (int i = 0; i < 6; i++){
   lcd.println(myStrings[i]);
   delay(500);
   }

When you say I need to display the data in an array, do you mean set up the text as a string?

Yes, assuming that you know what a string is.

The strings should be defined in the "transmitter" code, right?

No. The transmitter may be converting an analogRead value to a string on the fly, as it transmits it. It is the receiver that needs to understand that the collection of characters is a string.

You could use a "sliding window" that moves across the message after the receiver has it. This short program demonstrates the concept:

#define COLS   16
#define PAUSE  100

void setup() {

  char msg[] = "This is a test that is longer than the LCD window.";
  
  Serial.begin(115200);
  ScrollMessage(msg);
}

void ScrollMessage(char *msg)
{
  int index = 0;
  int i;
 
  for (i = 0; i < COLS && msg[i]; i++) {
    Serial.print(msg[i]);
  }
  
  Serial.println();
  index = 1;
  while (msg[index]) {
    //lcd.setCursor(0,1);
    for (i = 0; i < COLS && msg[i + index]; i++) {
      Serial.print(msg[i + index]);  // lcd.print() here
    }
    Serial.println();    // This would come out
    delay(PAUSE);        // Replace with better pause control
    index++;
  }
   
}  
    
void loop() {

}

I don't fully know how the data are being received, but I'm going along with Paul's suggestion that you buffer it up into a char array (named msg in my example). If you were typing a test string in from the Serial object, I'd use something like:

// code to the point of reading the input into the array...

   int charsRead;

   if (Serial.available() > 0) {
      charsRead = Serial.readBytesUntil('\n', msg, 20); // Read up to 20 chars or newline
      msg[charsRead] = '\0';                            // Make it a string...
   }
   ScrollMessage(msg);

   // rest of code

This would give you a way to test it using the Serial object rather than your transmitter. Once you're happy with it, then start pumping in the data from the transmitter.