Renamed NC macro

This commit is contained in:
jgromes 2020-03-27 14:11:13 +01:00
parent 39c259848c
commit c9785f30b2
8 changed files with 18 additions and 15 deletions

View file

@ -21,7 +21,7 @@
// GDO0 pin: 2 // GDO0 pin: 2
// RST pin: unused // RST pin: unused
// GDO2 pin: 3 (optional) // GDO2 pin: 3 (optional)
CC1101 cc = new Module(10, 2, NC, 3); CC1101 cc = new Module(10, 2, RADIOLIB_NC, 3);
// or using RadioShield // or using RadioShield
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield

View file

@ -19,7 +19,7 @@
// GDO0 pin: 2 // GDO0 pin: 2
// RST pin: unused // RST pin: unused
// GDO2 pin: 3 (optional) // GDO2 pin: 3 (optional)
CC1101 cc = new Module(10, 2, NC, 3); CC1101 cc = new Module(10, 2, RADIOLIB_NC, 3);
// or using RadioShield // or using RadioShield
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield

View file

@ -24,7 +24,7 @@
// GDO0 pin: 2 // GDO0 pin: 2
// RST pin: unused // RST pin: unused
// GDO2 pin: 3 (optional) // GDO2 pin: 3 (optional)
CC1101 cc = new Module(10, 2, NC, 3); CC1101 cc = new Module(5, 2, RADIOLIB_NC, 3);
// or using RadioShield // or using RadioShield
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
@ -105,22 +105,25 @@ void loop() {
receivedFlag = false; receivedFlag = false;
// you can read received data as an Arduino String // you can read received data as an Arduino String
String str; //String str;
int state = cc.readData(str); //int state = cc.readData(str);
// you can also read received data as byte array // you can also read received data as byte array
/*
byte byteArr[8]; byte byteArr[8];
int state = cc.readData(byteArr, 8); int state = cc.readData(byteArr, 8);
*/
if (state == ERR_NONE) { if (state == ERR_NONE) {
// packet was successfully received // packet was successfully received
Serial.println(F("[CC1101] Received packet!")); Serial.println(F("[CC1101] Received packet!"));
// print data of the packet // print data of the packet
Serial.print(F("[CC1101] Data:\t\t")); Serial.println(F("[CC1101] Data:\t\t"));
Serial.println(str); //Serial.println(str);
for(uint8_t i = 0; i < 8; i++) {
Serial.println(byteArr[i], HEX);
}
// print RSSI (Received Signal Strength Indicator) // print RSSI (Received Signal Strength Indicator)
// of the last received packet // of the last received packet

View file

@ -23,14 +23,14 @@
// GDO0 pin: 2 // GDO0 pin: 2
// RST pin: unused // RST pin: unused
// GDO2 pin: 3 (optional) // 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: // second CC1101 has different connections:
// CS pin: 9 // CS pin: 9
// GDO0 pin: 4 // GDO0 pin: 4
// RST pin: unused // RST pin: unused
// GDO2 pin: 5 (optional) // GDO2 pin: 5 (optional)
CC1101 cc2 = new Module(9, 4, NC, 53); CC1101 cc2 = new Module(9, 4, RADIOLIB_NC, 53);
// or using RadioShield // or using RadioShield
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield

View file

@ -19,7 +19,7 @@
// GDO0 pin: 2 // GDO0 pin: 2
// RST pin: unused // RST pin: unused
// GDO2 pin: 3 (optional) // GDO2 pin: 3 (optional)
CC1101 cc = new Module(10, 2, NC, 3); CC1101 cc = new Module(10, 2, RADIOLIB_NC, 3);
// or using RadioShield // or using RadioShield
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield

View file

@ -19,7 +19,7 @@
// GDO0 pin: 2 // GDO0 pin: 2
// RST pin: unused // RST pin: unused
// GDO2 pin: 3 (optional) // GDO2 pin: 3 (optional)
CC1101 cc = new Module(10, 2, NC, 3); CC1101 cc = new Module(10, 2, RADIOLIB_NC, 3);
// or using RadioShield // or using RadioShield
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield

View file

@ -20,7 +20,7 @@
// GDO0 pin: 2 // GDO0 pin: 2
// RST pin: unused // RST pin: unused
// GDO2 pin: 3 (optional) // GDO2 pin: 3 (optional)
CC1101 cc = new Module(10, 2, NC, 3); CC1101 cc = new Module(10, 2, RADIOLIB_NC, 3);
// or using RadioShield // or using RadioShield
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield

View file

@ -188,7 +188,7 @@ sendFrame KEYWORD2
# Constants (LITERAL1) # Constants (LITERAL1)
####################################### #######################################
NC LITERAL1 RADIOLIB_NC LITERAL1
RADIOLIB_VERSION LITERAL1 RADIOLIB_VERSION LITERAL1
ERR_NONE LITERAL1 ERR_NONE LITERAL1