How to I get the Arduino to serial print the last string of data received until a new one is received? I am wanting to use this on a scoreboard so that the scoreboard will show the last bit of information displayed when the controller is turned off instead of the scoreboard going blank because it stopped receiving data. I can get the Arduino to send the data to the scoreboard using a RS-485 to TTL converter and using the basic serial passthrough sketch. The only problem with that sketch is the Arduino stops sending data to the scoreboard once it stops receiving data. Can anyone help me with the code to get the Arduino to continue sending data?
When you check if you have something in the serial buffer, by using Serial.available() in an if statement and you get nothing then you display what you had before, using the else clause of the if statement.
However we need to know a lot more about this display before we can be more specific about the code. A good start is to post what you have.
That does make sense. What other information do I need to get? I don't know a whole lot about what kind of data is being sent out. I just know that it's RS-485 signal. Using the serial passthrough, I can get it to work with multiple scoreboard manufacturers that use RS-485 because all it's doing is sending out the same signal that it is receiving.
You need to know how many bytes constitute a score board message, so you know how many bytes you need when playing back a previous message.
this help is possible if you:
-
describe how many bytes are sended
because you need to define an array of char that is big enough to hold all bytes -
describe what microcontroller you are using
to check if this microcontroller has enough RAM to store each byte -
post your complete sketch as a code-section
There is an automatic function for doing this in the Arduino-IDE
just three steps
- press Ctrl-T for autoformatting your code
- do a rightclick with the mouse and choose "copy for forum"
- paste clipboard into write-window of a posting
best regards Stefan
why does the score stop displaying what ever it received last? was it cleared? does it turn-off if it doesn't receive a message periodically (a heartbeat)?
please post you code
When the scoreboard loses signal, it stops displaying anything on the scoreboard.
Attached is an example of the data packet. I do have a 6 page PDF that's detailed on how the signal is laid out. Here is the link. Hopefully this helps. Multi-drop Protocol.pdf - Google Drive

on page B-3 of the Multi-drop Protocol link, in the list of control byte values for Byte 1, what does value 20 - Received Data 0-hold, 1-show suggest
I'm not sure what the value 20 suggests.
that command has an option to presumably update the dispay or hold it. in other words, continue to display what was previously received
That appendix talks about a current loop output not an RS485 signal.
So how many digits does your display have?
Have you access to the rest of that document about the score board?
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.