Arduino Ethernet Shield hooked up to LED message display

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.

  1. int stringToInt(String thisString) {
  2.   String letters = " !’#$%&’()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[/]^_`abcdefghijklmnopqrstuvwxyz{|}~";
  3.  
  4.   int newstr = 32 + letters.indexOf(thisString);
  5.  
  6.   return newstr;
  7. }
  8.  
  9. String generateMessage(String inputString) {
  10.  
  11.   byte checksum = 0×74;
  12.   int i;
  13.  
  14.   for(i = 0;i < inputString.length();i++) {
  15.       String currentChar    = inputString.substring(i,i+1);
  16.       int asciiChar         = stringToInt(currentChar);
  17.       checksum = checksum ^ asciiChar;
  18.   }
  19.  
  20.    String hexStr =  String(checksum, HEX);
  21.    hexStr.toUpperCase();
  22.    
  23.    String message = "<ID00><L1><PA><FE><MA><WC><FE>" + inputString + hexStr + "<E>";
  24.    return message;
  25.    
  26. }
  27.  
  28. String myString = "My led display message here";
  29.  String mess = generateMessage(myString);
  30.   Serial.print(mess);

Download my Arduino library on Github to try this out.

Control servo motor

The servo motor can be controlled by using the servo library(Servo.h) in Arduino IDE. Plug in the control wire of the servo motor into one of the PWM pins. Attach the servo object to that pin.

  1. Servo servoMotor;
  2. servoMotor.attach(9);

To rotate the servo motor pass in a number between 0 and 180. The servo motor can only move up to 180 degrees.

  1. myservo.write(90);
  2. delay(2000);
  3. myservo.write(180);
  4. delay(2000);