This hack allows you to display messages to a standard Amplus LED Message Display from Clas Ohlsson. The display is controlled by a remote control and via a RJ14 cable plugged into the screen. Serial data is transmitted from cable to the screen. The LED Message display expects the message you pass to it to be encrypted with a check sum. With the help of Rasmus blog post I could generate this checksum in Arduino. I turned his Perl code into Arduino code that you can see below.
-
int stringToInt(String thisString) {
-
String letters = " !’#$%&’()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[/]^_`abcdefghijklmnopqrstuvwxyz{|}~";
-
-
int newstr = 32 + letters.indexOf(thisString);
-
-
return newstr;
-
}
-
-
String generateMessage(String inputString) {
-
-
byte checksum = 0×74;
-
int i;
-
-
for(i = 0;i < inputString.length();i++) {
-
String currentChar = inputString.substring(i,i+1);
-
int asciiChar = stringToInt(currentChar);
-
checksum = checksum ^ asciiChar;
-
}
-
-
String hexStr = String(checksum, HEX);
-
hexStr.toUpperCase();
-
-
String message = "<ID00><L1><PA><FE><MA><WC><FE>" + inputString + hexStr + "<E>";
-
return message;
-
-
}
-
-
String myString = "My led display message here";
-
String mess = generateMessage(myString);
-
Serial.print(mess);
Download my Arduino library on Github to try this out.
can i define where the message i sent it will appear in the led display & can i show two different message in the same time
Hi Mostafa!
You can send a long message containing both messages or send one to page a and one message to page b and then switch between them. The code library I supplied does not support switching between pages but you could look at the protocol and see what does.
Hope it helps!
Why is the 5V connected to the message display? It should work with only transmit and ground connected, or am I wrong?
Thanks for your answer
& please i have another questions :
i like this project very much
1- if this library help me to use led screen like LCD arduino libirary ( first set cursor then print message and clear it when i need )
2- can i print or show variable value in this libirary
messageBoard.displayMessage(PAGE_A,”My message!”);
i need to print variable x can i do this
messageBoard.displayMessage(PAGE_A, x);
please , if i have screen with RS232 cable can you help me how i control it with arduino
thanks
@Mostafa what kind of screen do you have connected to your RS232 cable?
@Mostafa
You can print your variable message with the following code:
String pageValue = connectAndRead(); //connect to the server and read the output
String myMessage = “My personal message”;
messageBoard.displayMessage(PAGE_A, myMessage);
Hi Ellen,
I am working on this same project but using a different board ( LPD8008 http://www.embeddedadventures.com/LED_matrix_display_LDP-8008.html). The intent is to have a program that displays different messages at different times.
But I am finding a few problems, primarily because I am very new to the entire Arduino and electronics world.
First I cannot figure out how to connect the LED matrix to the Atmega328. Second, I have past the code you gave above here but I keep on getting this error:
sketch_may06b:13: error: stray ‘\’ in program
sketch_may06b:11: error: expected unqualified-id before ‘{‘ token
at this point of the sketch:
String generateMessage(String inputString); {
byte checksum = 0×74;
int i;
Again, I am at the very start, so it is a bit difficult for me to find errors in a code.
Is there any chance you would be so kind to help?
Many thanks