I'm doing this for my YouTube Channel Gear Down For What If you can help me out, ill give you a shoutout! Thanks in advance!
The Board is an Arduino MEGA
The sign is a huge LED matrix array that is 7 x 96, and in the documentation says that it is J1708 serial protocol, but from what I understand that is baiscally RS-485, which is good, because I have a RS-485 Converter
So for the connections, I have the sign powered, and it boots up. I have the RS-485 converter powered, the light comes on, the serial "A" terminal is connected to the serial "A" terminal on the sign, the same with the "B" Terminals. On the Arduino to converter side I have DE and RE connected together and going back to Pin 3, Then DI on the converter is going back to TX1
Documentation for the sign Can be found here
So, according to the documentation, I have to send a "M" style message with the characters to display, and then confirm the selection with a "T" Trigger style message, and, I know the program is doing this in a really crude way, but when I do a test with the serial monitor, it seems like everything should be sending correctly.
I just don't understand where I'm going wrong.
#define SerialTxControl 3 //RS485 Direction control
#define RS485Transmit HIGH
#define RS485Receive LOW
#define Pin13LED 13
const int MSGL = 13;
const int MSGL2 = 6;
byte Byte[MSGL];
byte Trigger[MSGL2];
void setup() /****** SETUP: RUNS ONCE ******/
{
Byte[0] = 194;
Byte[1] = 255;
Byte[2] = 245;
Byte[3] = 4; //Bytes of data sent
Byte[4] = 'M';
Byte[5] = 1; // Sign Number 0 will brodcast to all
Byte[6] = 1; //
Byte[7] = 0; // Horizontal position
Byte[8] = 'G';
Byte[9] = 'D';
Byte[10] = 'F';
Byte[11] = 'W';
Trigger[0] = 194;
Trigger[1] = 255;
Trigger[2] = 245;
Trigger[3] = 1; //Byte Counts of Following Data
Trigger[4] = 'T';// Message Type
// Start the built-in serial port, probably to Serial Monitor
Serial.begin(9600);
Serial1.begin(9600);
pinMode(Pin13LED, OUTPUT);
pinMode(SerialTxControl, OUTPUT);
digitalWrite(SerialTxControl, RS485Transmit); // Init Transceiver
}//--(end setup )---
void loop() /****** LOOP: RUNS CONSTANTLY ******/
{
byte chk = 0;
for ( int i=0; i<MSGL; i++) { //length = 19 (22-02 = 20 - 1)
chk += Byte[i];
}
Byte[12] = chk;
//sum=10+C1+00+00+00+3E+90+32+00+21+16+10+1E+11+01+33+C1+0A+CD+19 = 042C
//discard accumulated carries; we get 2C = 0010 1100
//take 2's complemet code : 1101 0011 + 1 = D4
Serial.println("WriteM");
for ( int i=0; i<MSGL; i++) { //length = 19 (22-02 = 20 - 1)
Serial1.write(Byte[i]);
Serial.println(Byte[i]);
}
for ( int i=0; i<MSGL; i++) { //length = 19 (22-02 = 20 - 1)
chk += Byte[i];
}
Trigger[5] = chk;
Serial.println("WriteT");
for ( int i=0; i<MSGL2; i++) { //length = 19 (22-02 = 20 - 1)
Serial1.write(Trigger[i]);
Serial.println(Trigger[i]);
}
delay(2000);
}//--(end main loop )---
[code/]