Smart Home Automation Forum

Full Version: [Arduino source code for KC868-AP]-03 _RS485_communication
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
 [Arduino source code for KC868-AP]-03 _RS485_communication
Code:
void setup() {
  Serial.begin(115200);
  Serial2.begin(115200,SERIAL_8N1,33,14);
   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);
}