Adaptive Alpha Sign text message

Hi @Seoulhawk
I have tested this way:

look the analuse image.

PS; I forgot the x/04 at the end.
Now try this:


 Serial.write ("\x00\x00\x00\x00\x00\x01\x5A\x00\x02\xAA\x48\x45\x4C\x4C\x51\x04", 16);`

ops one more error.
It's not Hex xAA, it's x41 x41.

Serial.write ("\x00\x00\x00\x00\x00\x01\x5A\x00\x02\x41\x41\x48\x45\x4C\x4C\x51\x04", 17);


void setup() {
  Serial.begin(9600);
}
//===========================================================
void loop() {
  Serial.write ("\x00\x00\x00\x00\x00\x01\x5A\x00\x02\xAA\x48\x45\x4C\x4C\x51", 15);
  delay(100);

}

.println() won't work, as I explained before. You MUST use .write() and you MUST specify the number of bytes in the message.

So.... This is what I put in.

Serial2.write("\x00\x00\x00\x00\x00\x01\x5A\x00\x02\xAA\x48\x45\x4C\x4C\x51", 15);
      Serial2.print("HELLO");
      Serial2.write("\x04");

When I put connect it to putty, not sign, putty shows me this.

Z▒HELLQHELLO

The sign does nothing.

A friend that has experience with this sigh sent me this image.

So I think I understand the write/print/write Hex/ASCII/Hex, but the hex he gave is different and I still have not made it work.

Just to note...
\x48\x45\x4C\x4C\x51
is the word HELLO... so it's being sent twice

Hex code from your friend:
00 00 00 00 00 01 Z00 02 AA 1B 20 1C 31

00 00 00 00 00 > five NUL characters
01 > SOH (HEX)
Z00 > Z = type code (all signs), 00 sign address (ASCII)
02 > STX (HEX)
AA > A = Write text file command, A = file label (ASCII)
1B > ESC (HEX)
20 > Middle Line, Text Centered Vertically (HEX)
1C > Select Character Color (HEX)
31 > Red (HEX)

As a test, see if this code will display anything:


byte command[] = "\x00\x00\x00\x00\x00\x01Z00\x02""AA\x1B\x20\x1C\x31PAIK Auditorium\x04";

void setup() {
  Serial.begin(9600);
  Serial2.begin(9600);
  delay(1000);
  Serial.write(command, sizeof(command) - 1);
  Serial.println();
  for (size_t i = 0; i < sizeof(command) - 1; i++) {
    if (command[i] < 0x10)
      Serial.print('0');
    Serial.print(command[i], HEX);
    Serial.print(' ');
  }
  Serial.println();
  
  Serial2.write(command, sizeof(command) - 1);
}

void loop() {
}

Are you sure you have the RS232 converter wired to the sign correctly?

David,

Q. Are you sure you have the RS232 converter wired to the sign correctly?
A. That is why I keep connecting to putty, which makes sure that I am transmitting something. As for the cabling from the converter to the sign... It's three wires. I know which one is ground so that only leaves TX/RX and each time I try I will try twice and rotate the two wires.

The programing you provided is a step beyond what I have experience with. From what I see the command is being referenced in the code. Sorry for being dumb, but I am not a programmer, just a guy with bad ideas.

How exactly are you wiring the RS-232? From what I can find, the sign has a 6-pin RJ-11 (telephone) connector, with pin 6 being ground, pin 3 RS-232 TXD, pin 4 RS-232 RXD. (pins numbered from left to right, connector tab on top).

90% Sure I have that right.

This is interesting

OOOWEE! I have scrolling text on my sign.

Everyone, Thank you for your help. I will get back to this tomorrow. Few more things to work out then I will post my end result.

David,

When I paste in.

byte command[] = "\x00\x00\x00\x00\x00\x01Z00\x02""AA\x1B\x20\x1C\x31PAIK Auditorium\x04";

void setup() {
  Serial.begin(9600);
  Serial2.begin(9600);
  delay(1000);
  Serial.write(command, sizeof(command) - 1);
  Serial.println();
  for (size_t i = 0; i < sizeof(command) - 1; i++) {
    if (command[i] < 0x10)
      Serial.print('0');
    Serial.print(command[i], HEX);
    Serial.print(' ');
  }
  Serial.println();
  
  Serial2.write(command, sizeof(command) - 1);
}

void loop() {
}

I get the response from the sign "1PAIK Auditorium" scrolling and the color is constantly changing.

Using the following command I was able to get the text centered on the screen in the color green. It says GREEN x32.

Serial2.write("\x00\x00\x00\x00\x00\x01Z00\x02""AA\x1B\x20\x62\x1C\x32", 18);
      Serial2.print("GREEN x32!");
      Serial2.write("\x04");

I don't understand what the 18 is supposed to do. Can someone explain to me what that is for?

The 18 tells the write() function how many bytes you are sending to Serial2, without that the write() function will stop at the first null (0x00) in the text string. In the code you posted in reply #34 it should be 17 instead of 18 if I counted correctly.

I got the command slightly wrong in the code I posted last week, but I see you found the \x62 for stationary text. Difficult to know for sure when I don't have the hardware here for testing.

David, Thank you... But... So it's sending the 00 up to the 02?

No, should be sending the entire string. The compiler combines the two quoted texts together since they are adjacent. It was necessary to split the text into two quoted segments to prevent the compiler from seeing \02AA as a large HEX number.

I am still not getting it.... I just don't know what I am suppose to be adding up to 17.... When working with the sign I just started running through numbers and watched what changed with each number.

In the text, each hex number (\x followed by two characters) counts as 1 byte, and each character counts as 1 byte. The compiler will add an additional null at the end of the string, but you do not want to send that so do not count it. Do not count the quote marks.

Does x04 count?