Updated XBee node examples

pull/1/head
Jan Gromeš 2018-04-02 13:23:44 +02:00
rodzic 331d96979a
commit d4c8d4666d
2 zmienionych plików z 21 dodań i 0 usunięć

Wyświetl plik

@ -18,6 +18,16 @@ void setup() {
while(true);
}
Serial.print("[XBee] Setting PAN ID ... ");
state = bee.setPanId("0123456789ABCDEF");
if(state == ERR_NONE) {
Serial.println("success!");
} else {
Serial.print("failed, code 0x");
Serial.println(state, HEX);
while(true);
}
Serial.print("[XBee] Setting destination address ... ");
state = bee.setDestinationAddress("0013A200", "40A58A5D");
if(state == ERR_NONE) {
@ -42,6 +52,7 @@ void setup() {
void loop() {
Serial.print("[RF69] Waiting for incoming transmission ... ");
byte state = rf.receive(pack);
bee.println("Hello World!");
if(state == ERR_NONE) {
Serial.println("success!");

Wyświetl plik

@ -16,6 +16,16 @@ void setup() {
while(true);
}
Serial.print("[XBee] Setting PAN ID ... ");
state = bee.setPanId("0123456789ABCDEF");
if(state == ERR_NONE) {
Serial.println("success!");
} else {
Serial.print("failed, code 0x");
Serial.println(state, HEX);
while(true);
}
Serial.print("[XBee] Setting destination address ... ");
state = bee.setDestinationAddress("0013A200", "40A58A5D");
if(state == ERR_NONE) {