kc868-arduino-library/examples/03-open all relay/03-open all relay.ino

28 lines
388 B
Arduino
Raw Permalink Normal View History

2022-10-08 16:43:22 +02:00
#include "KC868.h"
KC868 kc868(&Serial2); //create kc868 object
void setup() {
Serial.begin(115200);
delay(2000);
kc868.begin(115200);//begin kc868 with baud 115200
boolean ret = kc868.writeSwitchAllON(); //open all relay
Serial.printf("open all relay ");
if(ret)
Serial.println("success!");
else
Serial.println("fail.");
}
void loop(){
kc868.poll();
}