mirror of
https://github.com/hzkincony/kc868-arduino-library.git
synced 2024-11-09 23:28:26 +01:00
28 lines
388 B
Arduino
28 lines
388 B
Arduino
|
#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();
|
||
|
|
||
|
}
|