FIFO Loop with 20X4 LCD & Arduino UNO.. suggestions please

Hello I would like to display messages onto a 20x4 LCD in a FIFO queue order and output onto the four lcd rows.
Messages need to be displayed firstly onto the 1st row, then as new messages is input into the FIFO queue, the 1st message move down to the 2nd,3rd and finally the 4th row after which the message is discarded from the memory buffer.
20X4LCD Examples
Example 1:
1st MSG
Empty Row
Empty Row
Empty Row

Example 2:
2nd MSG
1st MSG
Empty Row
Empty Row

Example 3:
3rd MSG
2nd MSG
1st MSG
Empty Row

Example 4:
4th MSG
3rd MSG
2nd MSG
1st MSG

Example 5:
5th MSG
4th MSG
3rd MSG
2nd MSG

It should go on like this in a loop, is there anyway to buffer 4 messages of 20 characters each (total 80) and have it display in that order? How may I proceed?

Hello,

It's quite simple, what have you tried ? Also, link to your LCD and library that you use.

Here is a quick example of how you could possibly do it. There are other ways, this one is probably the easiest to understand: oeBdsk - Online C++ Compiler & Debugging Tool - Ideone.com

Hi thank you for the link.
And to answer your questions, it's a 20x4 LCD based on the HD44780, it's connected in parallel and working fine with the LiquidCrystal.h library from the Arduino 1.6.7 IDE. I'm still learning myself, found this QueueList library and I've been looking around on the FIFO queue and how to write the code. Any more help is greatly appreciated.

LCD from ebay:
http://www.ebay.com/itm/Brand-New-2004-LCD-Module-for-Arduino-20x4-Screen-Based-on-HD44780-Controller-/191631585629?hash=item2c9e21f15d

LiquidCrystal.h library from Arduino IDE 1.6.7.

QueueList.h library from Arduino Playground:
http://playground.arduino.cc/Code/QueueList

LCD is connected to the six interface pin (12, 11, 10, 6, 5, 4).
I'm using the serialDisplay example from Arduino IDE to start with, so far I havn't had a clue on how to modify it (still learning).

CODE :
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 10, 6, 5, 4);
void setup() {
** // set up the LCD's number of columns and rows:**
** lcd.begin(20, 4);**
** // initialize the serial communications:**
** Serial.begin(9600);**
}
void loop() {
** // when characters arrive over the serial port...**
** if (Serial.available()) {**
** // wait a bit for the entire message to arrive**
** delay(100);**
** // clear the screen**
** lcd.clear();**
** // read all the available characters**
** while (Serial.available() > 0) {**
** // display each character to the LCD**
** lcd.write(Serial.read());**
** }**
** }**
}

guix:
Here is a quick example of how you could possibly do it. There are other ways, this one is probably the easiest to understand: oeBdsk - Online C++ Compiler & Debugging Tool - Ideone.com

How do I edit this code with Arduino and implement it into the code below?
The input is c and output lcd.print with 4 lines, 20 characters each.

void loop() {
char c;
if (sms.available()) // If there are any SMSs available()
{
lcd.clear();

while (c = sms.read()) // Read message bytes and print them
{
lcd.write(c);
}
{
delay(2000);
}
sms.flush();// Delete message from memory
}
}

tiksh07:
How do I edit this code with Arduino and implement it into the code below?
The input is c and output lcd.print with 4 lines, 20 characters each.

void loop() {
char c;
if (sms.available()) // If there are any SMSs available()
{
lcd.clear();

while (c = sms.read()) // Read message bytes and print them
{
lcd.write(c);
}
{
delay(2000);
}
sms.flush();// Delete message from memory
}
}

This code only display one message on one line only, and it clears the display when a 2nd message is input and display the 2nd message on the same line.

Here is what you have to do basically:

if there is a new sms
{

  • store every characters of this sms to a buffer (add a '\0' at the end to make it a valid C string)
  • call function addString (from my example) with the above buffer as parameter
  • clear lcd
  • draw all strings to the lcd, similarly to my printStrings function (you will have to use lcd.setCursor too)
    }

guix:
Here is what you have to do basically:

if there is a new sms
{

  • store every characters of this sms to a buffer (add a '\0' at the end to make it a valid C string)
  • call function addString (from my example) with the above buffer as parameter
  • clear lcd
  • draw all strings to the lcd, similarly to my printStrings function (you will have to use lcd.setCursor too)
    }

Thank you, I will get back to you as soon as I make some progress.