[RF69] Fixed typos in examples
This commit is contained in:
parent
3ad3e0cd61
commit
6e31c7b9be
6 changed files with 18 additions and 19 deletions
|
@ -35,7 +35,7 @@ void setup() {
|
|||
}
|
||||
|
||||
// set node address
|
||||
// NOTE: calling this method will autmatically enable
|
||||
// NOTE: calling this method will automatically enable
|
||||
// address filtering (node address only)
|
||||
Serial.print(F("[RF69] Setting node address ... "));
|
||||
state = rf.setNodeAddress(0x02);
|
||||
|
|
|
@ -14,7 +14,7 @@ RF69 rf = RadioShield.ModuleA;
|
|||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
|
||||
|
||||
// initialize RF69 with default settings
|
||||
Serial.print(F("[RF69] Initializing ... "));
|
||||
// carrier frequency: 434.0 MHz
|
||||
|
@ -32,10 +32,10 @@ void setup() {
|
|||
while (true);
|
||||
}
|
||||
|
||||
// set the function that will be called
|
||||
// set the function that will be called
|
||||
// when new packet is received
|
||||
rf.setDio0Action(setFlag);
|
||||
|
||||
|
||||
// start listening for packets
|
||||
Serial.print(F("[RF69] Starting to listen ... "));
|
||||
state = rf.startReceive();
|
||||
|
@ -54,7 +54,6 @@ void setup() {
|
|||
// rf.sleep()
|
||||
// rf.transmit();
|
||||
// rf.receive();
|
||||
// rf.scanChannel();
|
||||
}
|
||||
|
||||
// flag to indicate that a packet was received
|
||||
|
@ -86,23 +85,23 @@ void loop() {
|
|||
|
||||
// reset flag
|
||||
receivedFlag = false;
|
||||
|
||||
|
||||
// you can read received data as an Arduino String
|
||||
String str;
|
||||
int state = rf.readData(str);
|
||||
|
||||
|
||||
// you can also read received data as byte array
|
||||
/*
|
||||
byte byteArr[8];
|
||||
int state = lora.receive(byteArr, 8);
|
||||
*/
|
||||
|
||||
|
||||
if (state == ERR_NONE) {
|
||||
// packet was successfully received
|
||||
Serial.println("[RF69] Received packet!");
|
||||
|
||||
Serial.println(F("[RF69] Received packet!"));
|
||||
|
||||
// print data of the packet
|
||||
Serial.print("[RF69] Data:\t\t\t");
|
||||
Serial.print(F("[RF69] Data:\t\t\t"));
|
||||
Serial.println(str);
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ void setup() {
|
|||
}
|
||||
|
||||
// up to 8 bytes can be set as sync word
|
||||
// NOTE: sync word must not conatin any zero bytes
|
||||
// NOTE: sync word must not contain any zero bytes
|
||||
// set sync word to 0x0123456789ABCDEF
|
||||
uint8_t syncWord[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
|
||||
if (rf1.setSyncWord(syncWord, 8) == ERR_INVALID_SYNC_WORD) {
|
||||
|
|
|
@ -45,11 +45,11 @@ void loop() {
|
|||
|
||||
if (state == ERR_NONE) {
|
||||
// the packet was successfully transmitted
|
||||
Serial.println(" success!");
|
||||
Serial.println(F(" success!"));
|
||||
|
||||
} else if (state == ERR_PACKET_TOO_LONG) {
|
||||
// the supplied packet was longer than 64 bytes
|
||||
Serial.println(" too long!");
|
||||
Serial.println(F(" too long!"));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -62,11 +62,11 @@ void loop() {
|
|||
|
||||
if (state == ERR_NONE) {
|
||||
// the packet was successfully transmitted
|
||||
Serial.println(" success!");
|
||||
Serial.println(F(" success!"));
|
||||
|
||||
} else if (state == ERR_PACKET_TOO_LONG) {
|
||||
// the supplied packet was longer than 256 bytes
|
||||
Serial.println(" too long!");
|
||||
Serial.println(F(" too long!"));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ void setup() {
|
|||
}
|
||||
|
||||
// set broadcast address
|
||||
// NOTE: calling this method will autmatically enable
|
||||
// NOTE: calling this method will automatically enable
|
||||
// address filtering (node or broadcast address)
|
||||
Serial.print(F("[RF69] Setting broadcast address ... "));
|
||||
state = rf.setBroadcastAddress(0xFF);
|
||||
|
@ -101,11 +101,11 @@ void loop() {
|
|||
|
||||
if (state == ERR_NONE) {
|
||||
// the packet was successfully transmitted
|
||||
Serial.println(" success!");
|
||||
Serial.println(F(" success!"));
|
||||
|
||||
} else if (state == ERR_PACKET_TOO_LONG) {
|
||||
// the supplied packet was longer than 256 bytes
|
||||
Serial.println(" too long!");
|
||||
Serial.println(F(" too long!"));
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue