Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Arduino source code for KC868-A8M]-06 RS485
#3
(07-06-2023, 06:10 AM)Aiot Wrote:
(04-14-2023, 03:19 AM)KinCony Support Wrote: [Arduino source code for KC868-A8M]-06 RS485
Code:
#define A8M_RS485_RX 15
#define A8M_RS485_TX 13
void setup() {
  Serial.begin(115200);
  Serial2.begin(115200,SERIAL_8N1,A8M_RS485_RX,A8M_RS485_TX);//A8M
  Serial2.println("A8M RS485 SEND is OK!!"); 
}

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);
}
I want to use serial to show income data but no luck. Serial is empty. Do I need to add code to print in computer serial?

set like this:
   
   
Reply


Messages In This Thread
RE: [Arduino source code for KC868-A8M]-06 RS485 - by KinCony Support - 07-07-2023, 02:22 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)