From c9785f30b2b3d421b795dbbe82ca24b7fffe43ae Mon Sep 17 00:00:00 2001 From: jgromes Date: Fri, 27 Mar 2020 14:11:13 +0100 Subject: [PATCH] Renamed NC macro --- .../CC1101/CC1101_Receive/CC1101_Receive.ino | 2 +- .../CC1101_Receive_Address.ino | 2 +- .../CC1101_Receive_Interrupt.ino | 17 ++++++++++------- .../CC1101/CC1101_Settings/CC1101_Settings.ino | 4 ++-- .../CC1101/CC1101_Transmit/CC1101_Transmit.ino | 2 +- .../CC1101_Transmit_Address.ino | 2 +- .../CC1101_Transmit_Interrupt.ino | 2 +- keywords.txt | 2 +- 8 files changed, 18 insertions(+), 15 deletions(-) diff --git a/examples/CC1101/CC1101_Receive/CC1101_Receive.ino b/examples/CC1101/CC1101_Receive/CC1101_Receive.ino index e36c1d9a..fa8f3aa8 100644 --- a/examples/CC1101/CC1101_Receive/CC1101_Receive.ino +++ b/examples/CC1101/CC1101_Receive/CC1101_Receive.ino @@ -21,7 +21,7 @@ // GDO0 pin: 2 // RST pin: unused // GDO2 pin: 3 (optional) -CC1101 cc = new Module(10, 2, NC, 3); +CC1101 cc = new Module(10, 2, RADIOLIB_NC, 3); // or using RadioShield // https://github.com/jgromes/RadioShield diff --git a/examples/CC1101/CC1101_Receive_Address/CC1101_Receive_Address.ino b/examples/CC1101/CC1101_Receive_Address/CC1101_Receive_Address.ino index 4cbd10f2..3e12b6d5 100644 --- a/examples/CC1101/CC1101_Receive_Address/CC1101_Receive_Address.ino +++ b/examples/CC1101/CC1101_Receive_Address/CC1101_Receive_Address.ino @@ -19,7 +19,7 @@ // GDO0 pin: 2 // RST pin: unused // GDO2 pin: 3 (optional) -CC1101 cc = new Module(10, 2, NC, 3); +CC1101 cc = new Module(10, 2, RADIOLIB_NC, 3); // or using RadioShield // https://github.com/jgromes/RadioShield diff --git a/examples/CC1101/CC1101_Receive_Interrupt/CC1101_Receive_Interrupt.ino b/examples/CC1101/CC1101_Receive_Interrupt/CC1101_Receive_Interrupt.ino index 46f3279d..b57c4102 100644 --- a/examples/CC1101/CC1101_Receive_Interrupt/CC1101_Receive_Interrupt.ino +++ b/examples/CC1101/CC1101_Receive_Interrupt/CC1101_Receive_Interrupt.ino @@ -24,7 +24,7 @@ // GDO0 pin: 2 // RST pin: unused // GDO2 pin: 3 (optional) -CC1101 cc = new Module(10, 2, NC, 3); +CC1101 cc = new Module(5, 2, RADIOLIB_NC, 3); // or using RadioShield // https://github.com/jgromes/RadioShield @@ -105,22 +105,25 @@ void loop() { receivedFlag = false; // you can read received data as an Arduino String - String str; - int state = cc.readData(str); + //String str; + //int state = cc.readData(str); // you can also read received data as byte array - /* + byte byteArr[8]; int state = cc.readData(byteArr, 8); - */ + if (state == ERR_NONE) { // packet was successfully received Serial.println(F("[CC1101] Received packet!")); // print data of the packet - Serial.print(F("[CC1101] Data:\t\t")); - Serial.println(str); + Serial.println(F("[CC1101] Data:\t\t")); + //Serial.println(str); + for(uint8_t i = 0; i < 8; i++) { + Serial.println(byteArr[i], HEX); + } // print RSSI (Received Signal Strength Indicator) // of the last received packet diff --git a/examples/CC1101/CC1101_Settings/CC1101_Settings.ino b/examples/CC1101/CC1101_Settings/CC1101_Settings.ino index 74b2b3b1..02394da1 100644 --- a/examples/CC1101/CC1101_Settings/CC1101_Settings.ino +++ b/examples/CC1101/CC1101_Settings/CC1101_Settings.ino @@ -23,14 +23,14 @@ // GDO0 pin: 2 // RST pin: unused // GDO2 pin: 3 (optional) -CC1101 cc1 = new Module(10, 2, NC, 3); +CC1101 cc1 = new Module(10, 2, RADIOLIB_NC, 3); // second CC1101 has different connections: // CS pin: 9 // GDO0 pin: 4 // RST pin: unused // GDO2 pin: 5 (optional) -CC1101 cc2 = new Module(9, 4, NC, 53); +CC1101 cc2 = new Module(9, 4, RADIOLIB_NC, 53); // or using RadioShield // https://github.com/jgromes/RadioShield diff --git a/examples/CC1101/CC1101_Transmit/CC1101_Transmit.ino b/examples/CC1101/CC1101_Transmit/CC1101_Transmit.ino index 104fe2bb..be530890 100644 --- a/examples/CC1101/CC1101_Transmit/CC1101_Transmit.ino +++ b/examples/CC1101/CC1101_Transmit/CC1101_Transmit.ino @@ -19,7 +19,7 @@ // GDO0 pin: 2 // RST pin: unused // GDO2 pin: 3 (optional) -CC1101 cc = new Module(10, 2, NC, 3); +CC1101 cc = new Module(10, 2, RADIOLIB_NC, 3); // or using RadioShield // https://github.com/jgromes/RadioShield diff --git a/examples/CC1101/CC1101_Transmit_Address/CC1101_Transmit_Address.ino b/examples/CC1101/CC1101_Transmit_Address/CC1101_Transmit_Address.ino index 94905bad..e584eb7c 100644 --- a/examples/CC1101/CC1101_Transmit_Address/CC1101_Transmit_Address.ino +++ b/examples/CC1101/CC1101_Transmit_Address/CC1101_Transmit_Address.ino @@ -19,7 +19,7 @@ // GDO0 pin: 2 // RST pin: unused // GDO2 pin: 3 (optional) -CC1101 cc = new Module(10, 2, NC, 3); +CC1101 cc = new Module(10, 2, RADIOLIB_NC, 3); // or using RadioShield // https://github.com/jgromes/RadioShield diff --git a/examples/CC1101/CC1101_Transmit_Interrupt/CC1101_Transmit_Interrupt.ino b/examples/CC1101/CC1101_Transmit_Interrupt/CC1101_Transmit_Interrupt.ino index a89cf0ca..47991677 100644 --- a/examples/CC1101/CC1101_Transmit_Interrupt/CC1101_Transmit_Interrupt.ino +++ b/examples/CC1101/CC1101_Transmit_Interrupt/CC1101_Transmit_Interrupt.ino @@ -20,7 +20,7 @@ // GDO0 pin: 2 // RST pin: unused // GDO2 pin: 3 (optional) -CC1101 cc = new Module(10, 2, NC, 3); +CC1101 cc = new Module(10, 2, RADIOLIB_NC, 3); // or using RadioShield // https://github.com/jgromes/RadioShield diff --git a/keywords.txt b/keywords.txt index 10f66074..a5ba3b5a 100644 --- a/keywords.txt +++ b/keywords.txt @@ -188,7 +188,7 @@ sendFrame KEYWORD2 # Constants (LITERAL1) ####################################### -NC LITERAL1 +RADIOLIB_NC LITERAL1 RADIOLIB_VERSION LITERAL1 ERR_NONE LITERAL1