Go Down

Topic: Can't figure out how to endlessly feed text to arduino for display on LCD (Read 1 time) previous topic - next topic

teggroll

I'm trying to send a continuous feed of messages, each message about 200 chars, to the arduino, then display them one at a time, scrolling them off the screen before the next one appears.  At first, it was displaying only 1 or 2 messages before it stopped.  I increased my RX_BUFFER_SIZE in HardwareSerial.cpp to 1024, which has enabled me to now display closer to 15 messages, but it still stops.  How do I get past the stopping part and have the messages continuously to display on the LCD?

I've tried Serial.flush, Serial.end followed by another Serial.begin, I've tried doing things with the rx buffer head and tail, etc.  None of it has enabled me to achieve the non-stop display of messages I'm looking for.

Any help would be greatly appreciated?

Thanks,
Tim

Graynomad

You probably have to save them in an array but without seeing your code (Hint :)) it's hard to say.

______
Rob

Rob Gray aka the GRAYnomad www.robgray.com

MikMo

Does your messages come from a PC ?

If so then i tink it would be better to implement some kind of flow control, where your Arduino will signal to the PC "hey i'm ready for the next message"
If you just keep sending a stream of messages from the PC you will sooner or later run into memory issues on Arduino.

teggroll

Thanks for the replies.


Does your messages come from a PC ?
If so then i tink it would be better to implement some kind of flow control, where your Arduino will signal to the PC "hey i'm ready for the next message"
If you just keep sending a stream of messages from the PC you will sooner or later run into memory issues on Arduino.


I get what you're saying about memory and flow control.  I'm trying to figure out exactly what happens when flow control is implemented that allows you to continuously take in the next message.  In that flow control process, something is reset/cleared (eg. rx buffer head & tail, pointer(s), etc.)  Since I don't care if a message is lost or overwritten in the buffer once it has been written to the LCD, I either want to keep a continuous FIFO process of writing a message to the LCD and, if the buffer is full, reading in a new message to the buffer which overwrites the one that has been displayed or simply resetting the buffer each time a message is taken in and displayed so that, basically, the buffer only really holds one message at a time.


You probably have to save them in an array but without seeing your code (Hint :)) it's hard to say.


Unfortunately, I have many different version of the code, none of which have worked.  At the moment, I'm trying to get at the underlying process of what I'd like to achieve and then start from there.  The basic outline, though, seems to be one of these two:

read a number of strings into the buffer -> display them FIFO on the LCD -> allow just-displayed message to be overwritten by new string taken in, which becomes the last string at the end of the queue

or

read in a single string -> display it on the LCD -> reset the buffer -> take in next string

Hope this makes sense.

Thanks again,
Tim

Graynomad

This seems simple enough unless I don't grasp the idea.

As you say have a FIFO of strings and print them one at a time to the LCD.

As long as the overall frequency of inputs string is <= output string printing time (bearing in mind that LCDs are very slow) there shouldn't be a problem.

If this is not the case then you will have issues, and flow control won't help.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Go Up