P10 panel rs485 connection


I want to transfer information from the computer (using a simple sports program) to the scoreboard screen at a student sports event in the school gym. This is the system I made. I found a few sample codes but I couldn't do it.

Please post your best effort at writing or adapting a sketch to do what you want and describe the problems that you had. Please use code tags when you post it

@bykz1351
Why do you need a three arduinos to control a score board? How many P10 panels you plan to use?

3 panels per arduino

I can figure it out if there is an example code.

I think you are not quite understand how the forum works.
It is not a place to write a free codes for novices.

You hardly could expect that someone make code for you, but forum can helps, if you do it yourself. Try to write a code - and show your efforts.

11
21
31
41

11 957
21 658.458
31 STUDENT NAME
41 THECHER NAME

2 variables coming from master arduino com1 ( 957/ STUDENT NAME
How can I direct the other slave 1 and slave 2 to mega Arduino serial one and 2 according to the constants at the beginning (11/21 constant)

void setup() {
  // initialize both serial ports:
  Serial.begin(9600);
  Serial1.begin(9600);
  Serial2.begin(9600);
}

void loop() {
   
  
  // read from port 1, send to port 0:
  if (Serial.available()) {
    int inByte = Serial.read();
    Serial1.write(inByte);
    Serial2.write(inByte);
  

  }
}

2 variables coming from master arduino com1 ( 957/ STUDENT NAME
How can I direct the other slave 1 and slave 2 to mega Arduino serial one and 2 according to the constants at the beginning (11/21 constant)

The writing on the diagrams is too small to read.

It appears the master Arduino is just acting as a RS232-RS485 converter. If so, the code is quite simple, read from PC(RS232), write to RS485.

You've written USB-RS232 but that needs to be a USB-TTL adapter. Feeding RS232 voltage levels into an Arduino is bad for the Arduino.

Each slave might receive a message e.g "11 1 8 CR LF". Each slave needs to look at first 2 chars and decide "is this message for me?". If yes, then display the message otherwise ignore.

Of course, if you had a USB-RS485 adapter you probably would not need the master Arduino.

I already switched back to rs232. Only in my code, it sends both constants (11 and 21) together with the variables (957/ STUDENT NAME) to other Arduinos. While I am sending the constant 11 with its variable (it can be a number like 957) to slave 1. I couldn't manage to send the other constant (any student name) to slave 2.

Ok, so in post #9 you have changed the architecture. You have 2 options:

  1. The master copies data to all slaves. The slaves still need to process the message to see if it matches their address.

  2. The master stores an incoming message, and directs it to the correct slave.

Either way, how will the Arduinos know where the start and end of messages are?

To keep it simple, I suggest keeping it as a printable string and ending the message with CR LF.

Your HEX coding will go to the first Arduino, starting with 0x2 0x31 0x33 0x31 0x35 0x30 and ending with 0xa. The other slave 2 will go to Arduino, starting with 0x2 0x31 0x33 0x31 0x35 0x31 and ending with 0xa. There are 28 characters in between that change.

I think what you are saying is that messages start with 0x02, which is the ASCII control character known as STX, and end with 0x0A which is the control character known as LF. In between is some ASCII text, in the first case "13150". Perhaps that represents an address of some sort.

Not sure what the reference to "28 character in between" refers to.

28 characters is not very important. Can you help me? A little help on sending commands to the serial port would be nice. Thank you.

If it starts with 0x2 0x31 0x33 0x31 0x35 0x30, I want to send it to serial -1.
If it starts with 0x2 0x31 0x33 0x31 0x35 0x31, send it to Serial-2.
Thank you

And what is your problem?
Read first 6 chars of the message, if the 6th is 0x30 - send to the first port, if it 0x31 - to the second...

What;s I absolutely don't understand - why do you need a four Arduino Mega for such simple task... Why not to control all the panels by a single Arduino?

As I explained in the first picture, I will connect 8 LED P10 panels to each Arduino. But I am very weak in coding. I read everything in the whole forum, but I could not put it together in my mind and write a code.

So what's your problem?
Read the first 6 characters of the message, if the 6th character is 0x30, send it to the first port, if it is 0x31, send it to the second port...

This may seem easy to you, but it is very difficult for me.