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?
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 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());**
** }**
** }** }
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.