06-21-2023, 05:22 AM
(This post was last modified: 06-21-2023, 05:38 AM by KinCony Support.)
[Arduino source code for KC868-1U]-07_RS485
Code:
/*KC868-1U RS485 CODE*/
#define RS485RX 32
#define RS485TX 33
void setup() {
Serial.begin(115200);
Serial2.begin(115200,SERIAL_8N1,A2_RS485RX,A2_RS485TX);
Serial2.println("RS485 SEND is OK!!");
Serial2.println("******************");
}
void loop() {
/*print the received data of RS485 port*/
while(Serial2.available()>0)
{
Serial2.print((char)Serial2.read());//Read rs485 receive data and print it
}
delay(200);
}