diff --git a/examples/CC1101/CC1101_Receive/CC1101_Receive.ino b/examples/CC1101/CC1101_Receive/CC1101_Receive.ino index 038305fc..80962365 100644 --- a/examples/CC1101/CC1101_Receive/CC1101_Receive.ino +++ b/examples/CC1101/CC1101_Receive/CC1101_Receive.ino @@ -1,7 +1,7 @@ /* RadioLib CC1101 Receive Example - This example receives packets using CC1101 FSK radio + This example receives packets using CC1101 FSK radio module. */ @@ -52,15 +52,15 @@ void loop() { Serial.print(F("[CC1101] Data:\t\t")); Serial.println(str); - // print RSSI (Received Signal Strength Indicator) + // print RSSI (Received Signal Strength Indicator) // of the last received packet - Serial.print("[CC1101] RSSI:\t\t"); + Serial.print(F("[CC1101] RSSI:\t\t")); Serial.print(cc.getRSSI()); - Serial.println(" dBm"); + Serial.println(F(" dBm")); - // print LQI (Link Quality Indicator) + // print LQI (Link Quality Indicator) // of the last received packet, lower is better - Serial.print("[CC1101] LQI:\t\t"); + Serial.print(F("[CC1101] LQI:\t\t")); Serial.println(cc.getLQI()); } else if (state == ERR_CRC_MISMATCH) { diff --git a/examples/CC1101/CC1101_Receive_Address/CC1101_Receive_Address.ino b/examples/CC1101/CC1101_Receive_Address/CC1101_Receive_Address.ino index dc067fa7..066b6908 100644 --- a/examples/CC1101/CC1101_Receive_Address/CC1101_Receive_Address.ino +++ b/examples/CC1101/CC1101_Receive_Address/CC1101_Receive_Address.ino @@ -1,8 +1,8 @@ /* RadioLib CC1101 Receive with Address Example - This example receives packets using CC1101 FSK radio - module. Packets can have 1-byte address of the + This example receives packets using CC1101 FSK radio + module. Packets can have 1-byte address of the destination node. After setting node address, this node will automatically filter out any packets that do not contain either node address or broadcast addresses. @@ -16,7 +16,7 @@ CC1101 cc = RadioShield.ModuleA; void setup() { Serial.begin(9600); - + // initialize CC1101 with default settings Serial.print(F("[CC1101] Initializing ... ")); // carrier frequency: 868.0 MHz @@ -34,10 +34,10 @@ void setup() { } // set node address - // NOTE: Calling this method will autmatically enable + // NOTE: Calling this method will automatically enable // address filtering. CC1101 also allows to set // number of broadcast address (0/1/2). - // The following sets one brodcast address 0x00. + // The following sets one broadcast address 0x00. // When setting two broadcast addresses, 0x00 and // 0xFF will be used. Serial.print(F("[CC1101] Setting node address ... ")); @@ -51,7 +51,7 @@ void setup() { } // address filtering can also be disabled - // NOTE: Calling this method will also erase previously + // NOTE: Calling this method will also erase previously // set node address /* Serial.print(F("[CC1101] Disabling address filtering ... ")); @@ -87,15 +87,15 @@ void loop() { Serial.print(F("[CC1101] Data:\t\t")); Serial.println(str); - // print RSSI (Received Signal Strength Indicator) + // print RSSI (Received Signal Strength Indicator) // of the last received packet - Serial.print("[CC1101] RSSI:\t\t"); + Serial.print(F("[CC1101] RSSI:\t\t")); Serial.print(cc.getRSSI()); - Serial.println(" dBm"); + Serial.println(F(" dBm")); - // print LQI (Link Quality Indicator) + // print LQI (Link Quality Indicator) // of the last received packet, lower is better - Serial.print("[CC1101] LQI:\t\t"); + Serial.print(F("[CC1101] LQI:\t\t")); Serial.println(cc.getLQI()); } else if (state == ERR_CRC_MISMATCH) { diff --git a/examples/CC1101/CC1101_Receive_Interrupt/CC1101_Receive_Interrupt.ino b/examples/CC1101/CC1101_Receive_Interrupt/CC1101_Receive_Interrupt.ino index 5d0ec8b5..f5573df4 100644 --- a/examples/CC1101/CC1101_Receive_Interrupt/CC1101_Receive_Interrupt.ino +++ b/examples/CC1101/CC1101_Receive_Interrupt/CC1101_Receive_Interrupt.ino @@ -14,7 +14,7 @@ CC1101 cc = RadioShield.ModuleA; void setup() { Serial.begin(9600); - + // initialize CC1101 with default settings Serial.print(F("[CC1101] Initializing ... ")); // carrier frequency: 868.0 MHz @@ -30,11 +30,11 @@ void setup() { Serial.println(state); while (true); } - - // set the function that will be called + + // set the function that will be called // when new packet is received cc.setGdo0Action(setFlag); - + // start listening for packets Serial.print(F("[CC1101] Starting to listen ... ")); state = cc.startReceive(); @@ -53,7 +53,6 @@ void setup() { // cc.sleep() // cc.transmit(); // cc.receive(); - // cc.scanChannel(); } // flag to indicate that a packet was received @@ -85,34 +84,34 @@ void loop() { // reset flag receivedFlag = false; - + // you can read received data as an Arduino String String str; int state = cc.readData(str); - + // you can also read received data as byte array /* byte byteArr[8]; int state = cc.receive(byteArr, 8); */ - + if (state == ERR_NONE) { // packet was successfully received - Serial.println("[CC1101] Received packet!"); - + Serial.println(F("[CC1101] Received packet!")); + // print data of the packet - Serial.print("[CC1101] Data:\t\t"); + Serial.print(F("[CC1101] Data:\t\t")); Serial.println(str); - // print RSSI (Received Signal Strength Indicator) + // print RSSI (Received Signal Strength Indicator) // of the last received packet - Serial.print("[CC1101] RSSI:\t\t"); + Serial.print(F("[CC1101] RSSI:\t\t")); Serial.print(cc.getRSSI()); - Serial.println(" dBm"); - - // print LQI (Link Quality Indicator) + Serial.println(F(" dBm")); + + // print LQI (Link Quality Indicator) // of the last received packet, lower is better - Serial.print("[CC1101] LQI:\t\t"); + Serial.print(F("[CC1101] LQI:\t\t")); Serial.println(cc.getLQI()); } diff --git a/examples/CC1101/CC1101_Transmit/CC1101_Transmit.ino b/examples/CC1101/CC1101_Transmit/CC1101_Transmit.ino index 4147251c..28786d7b 100644 --- a/examples/CC1101/CC1101_Transmit/CC1101_Transmit.ino +++ b/examples/CC1101/CC1101_Transmit/CC1101_Transmit.ino @@ -44,11 +44,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 255 bytes - Serial.println(" too long!"); + Serial.println(F(" too long!")); } diff --git a/examples/CC1101/CC1101_Transmit_Address/CC1101_Transmit_Address.ino b/examples/CC1101/CC1101_Transmit_Address/CC1101_Transmit_Address.ino index 2466f8d6..7a0235fd 100644 --- a/examples/CC1101/CC1101_Transmit_Address/CC1101_Transmit_Address.ino +++ b/examples/CC1101/CC1101_Transmit_Address/CC1101_Transmit_Address.ino @@ -1,8 +1,8 @@ /* RadioLib CC1101 Transmit to Address Example - This example transmits packets using CC1101 FSK radio - module. Packets can have 1-byte address of the + This example transmits packets using CC1101 FSK radio + module. Packets can have 1-byte address of the destination node. After setting node address, this node will automatically filter out any packets that do not contain either node address or broadcast addresses. @@ -16,7 +16,7 @@ CC1101 cc = RadioShield.ModuleA; void setup() { Serial.begin(9600); - + // initialize CC1101 with default settings Serial.print(F("[CC1101] Initializing ... ")); // carrier frequency: 868.0 MHz @@ -34,10 +34,10 @@ void setup() { } // set node address - // NOTE: Calling this method will autmatically enable + // NOTE: Calling this method will automatically enable // address filtering. CC1101 also allows to set // number of broadcast address (0/1/2). - // The following sets one brodcast address 0x00. + // The following sets one broadcast address 0x00. // When setting two broadcast addresses, 0x00 and // 0xFF will be used. Serial.print(F("[CC1101] Setting node address ... ")); @@ -51,7 +51,7 @@ void setup() { } // address filtering can also be disabled - // NOTE: Calling this method will also erase previously + // NOTE: Calling this method will also erase previously // set node address /* Serial.print(F("[CC1101] Disabling address filtering ... ")); @@ -80,11 +80,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 255 bytes - Serial.println(" too long!"); + Serial.println(F(" too long!")); }