[CC1101] Added links to default config wiki page

This commit is contained in:
jgromes 2020-07-04 11:22:47 +02:00
parent 0d5b7cb3e9
commit 4819168d2e
7 changed files with 86 additions and 100 deletions

View file

@ -9,6 +9,9 @@
- frequency deviation - frequency deviation
- sync word - sync word
For default module settings, see the wiki page
https://github.com/jgromes/RadioLib/wiki/Default-configuration#cc1101
For full API reference, see the GitHub Pages For full API reference, see the GitHub Pages
https://jgromes.github.io/RadioLib/ https://jgromes.github.io/RadioLib/
*/ */
@ -21,23 +24,18 @@
// 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, RADIOLIB_NC, 3); CC1101 radio = new Module(10, 2, RADIOLIB_NC, 3);
// or using RadioShield // or using RadioShield
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
//CC1101 cc = RadioShield.ModuleA; //CC1101 radio = RadioShield.ModuleA;
void setup() { void setup() {
Serial.begin(9600); Serial.begin(9600);
// initialize CC1101 with default settings // initialize CC1101 with default settings
Serial.print(F("[CC1101] Initializing ... ")); Serial.print(F("[CC1101] Initializing ... "));
// carrier frequency: 868.0 MHz int state = radio.begin();
// bit rate: 4.8 kbps
// frequency deviation: 48.0 kHz
// Rx bandwidth: 325.0 kHz
// sync word: 0xD391
int state = cc.begin();
if (state == ERR_NONE) { if (state == ERR_NONE) {
Serial.println(F("success!")); Serial.println(F("success!"));
} else { } else {
@ -52,12 +50,12 @@ void loop() {
// you can receive data as an Arduino String // you can receive data as an Arduino String
String str; String str;
int state = cc.receive(str); int state = radio.receive(str);
// you can also receive data as byte array // you can also receive data as byte array
/* /*
byte byteArr[8]; byte byteArr[8];
int state = cc.receive(byteArr, 8); int state = radio.receive(byteArr, 8);
*/ */
if (state == ERR_NONE) { if (state == ERR_NONE) {
@ -71,13 +69,13 @@ void loop() {
// print RSSI (Received Signal Strength Indicator) // print RSSI (Received Signal Strength Indicator)
// of the last received packet // of the last received packet
Serial.print(F("[CC1101] RSSI:\t\t")); Serial.print(F("[CC1101] RSSI:\t\t"));
Serial.print(cc.getRSSI()); Serial.print(radio.getRSSI());
Serial.println(F(" dBm")); Serial.println(F(" dBm"));
// print LQI (Link Quality Indicator) // print LQI (Link Quality Indicator)
// of the last received packet, lower is better // of the last received packet, lower is better
Serial.print(F("[CC1101] LQI:\t\t")); Serial.print(F("[CC1101] LQI:\t\t"));
Serial.println(cc.getLQI()); Serial.println(radio.getLQI());
} else if (state == ERR_CRC_MISMATCH) { } else if (state == ERR_CRC_MISMATCH) {
// packet was received, but is malformed // packet was received, but is malformed

View file

@ -7,6 +7,9 @@
will automatically filter out any packets that do not will automatically filter out any packets that do not
contain either node address or broadcast addresses. contain either node address or broadcast addresses.
For default module settings, see the wiki page
https://github.com/jgromes/RadioLib/wiki/Default-configuration#cc1101
For full API reference, see the GitHub Pages For full API reference, see the GitHub Pages
https://jgromes.github.io/RadioLib/ https://jgromes.github.io/RadioLib/
*/ */
@ -19,23 +22,18 @@
// 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, RADIOLIB_NC, 3); CC1101 radio = new Module(10, 2, RADIOLIB_NC, 3);
// or using RadioShield // or using RadioShield
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
//CC1101 cc = RadioShield.ModuleA; //CC1101 radio = RadioShield.ModuleA;
void setup() { void setup() {
Serial.begin(9600); Serial.begin(9600);
// initialize CC1101 with default settings // initialize CC1101 with default settings
Serial.print(F("[CC1101] Initializing ... ")); Serial.print(F("[CC1101] Initializing ... "));
// carrier frequency: 868.0 MHz int state = radio.begin();
// bit rate: 4.8 kbps
// frequency deviation: 48.0 kHz
// Rx bandwidth: 325.0 kHz
// sync word: 0xD391
int state = cc.begin();
if (state == ERR_NONE) { if (state == ERR_NONE) {
Serial.println(F("success!")); Serial.println(F("success!"));
} else { } else {
@ -52,7 +50,7 @@ void setup() {
// When setting two broadcast addresses, 0x00 and // When setting two broadcast addresses, 0x00 and
// 0xFF will be used. // 0xFF will be used.
Serial.print(F("[CC1101] Setting node address ... ")); Serial.print(F("[CC1101] Setting node address ... "));
state = cc.setNodeAddress(0x01, 1); state = radio.setNodeAddress(0x01, 1);
if (state == ERR_NONE) { if (state == ERR_NONE) {
Serial.println(F("success!")); Serial.println(F("success!"));
} else { } else {
@ -66,7 +64,7 @@ void setup() {
// set node address // set node address
/* /*
Serial.print(F("[CC1101] Disabling address filtering ... ")); Serial.print(F("[CC1101] Disabling address filtering ... "));
state == cc.disableAddressFiltering(); state == radio.disableAddressFiltering();
if(state == ERR_NONE) { if(state == ERR_NONE) {
Serial.println(F("success!")); Serial.println(F("success!"));
} else { } else {
@ -82,12 +80,12 @@ void loop() {
// you can receive data as an Arduino String // you can receive data as an Arduino String
String str; String str;
int state = cc.receive(str); int state = radio.receive(str);
// you can also receive data as byte array // you can also receive data as byte array
/* /*
byte byteArr[8]; byte byteArr[8];
int state = cc.receive(byteArr, 8); int state = radio.receive(byteArr, 8);
*/ */
if (state == ERR_NONE) { if (state == ERR_NONE) {
@ -101,13 +99,13 @@ void loop() {
// print RSSI (Received Signal Strength Indicator) // print RSSI (Received Signal Strength Indicator)
// of the last received packet // of the last received packet
Serial.print(F("[CC1101] RSSI:\t\t")); Serial.print(F("[CC1101] RSSI:\t\t"));
Serial.print(cc.getRSSI()); Serial.print(radio.getRSSI());
Serial.println(F(" dBm")); Serial.println(F(" dBm"));
// print LQI (Link Quality Indicator) // print LQI (Link Quality Indicator)
// of the last received packet, lower is better // of the last received packet, lower is better
Serial.print(F("[CC1101] LQI:\t\t")); Serial.print(F("[CC1101] LQI:\t\t"));
Serial.println(cc.getLQI()); Serial.println(radio.getLQI());
} else if (state == ERR_CRC_MISMATCH) { } else if (state == ERR_CRC_MISMATCH) {
// packet was received, but is malformed // packet was received, but is malformed

View file

@ -12,6 +12,9 @@
- frequency deviation - frequency deviation
- sync word - sync word
For default module settings, see the wiki page
https://github.com/jgromes/RadioLib/wiki/Default-configuration#cc1101
For full API reference, see the GitHub Pages For full API reference, see the GitHub Pages
https://jgromes.github.io/RadioLib/ https://jgromes.github.io/RadioLib/
*/ */
@ -24,23 +27,18 @@
// 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, RADIOLIB_NC, 3); CC1101 radio = new Module(10, 2, RADIOLIB_NC, 3);
// or using RadioShield // or using RadioShield
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
//CC1101 cc = RadioShield.ModuleA; //CC1101 radio = RadioShield.ModuleA;
void setup() { void setup() {
Serial.begin(9600); Serial.begin(9600);
// initialize CC1101 with default settings // initialize CC1101 with default settings
Serial.print(F("[CC1101] Initializing ... ")); Serial.print(F("[CC1101] Initializing ... "));
// carrier frequency: 868.0 MHz int state = radio.begin();
// bit rate: 4.8 kbps
// frequency deviation: 48.0 kHz
// Rx bandwidth: 325.0 kHz
// sync word: 0xD391
int state = cc.begin();
if (state == ERR_NONE) { if (state == ERR_NONE) {
Serial.println(F("success!")); Serial.println(F("success!"));
} else { } else {
@ -51,11 +49,11 @@ void setup() {
// set the function that will be called // set the function that will be called
// when new packet is received // when new packet is received
cc.setGdo0Action(setFlag); radio.setGdo0Action(setFlag);
// start listening for packets // start listening for packets
Serial.print(F("[CC1101] Starting to listen ... ")); Serial.print(F("[CC1101] Starting to listen ... "));
state = cc.startReceive(); state = radio.startReceive();
if (state == ERR_NONE) { if (state == ERR_NONE) {
Serial.println(F("success!")); Serial.println(F("success!"));
} else { } else {
@ -67,11 +65,11 @@ void setup() {
// if needed, 'listen' mode can be disabled by calling // if needed, 'listen' mode can be disabled by calling
// any of the following methods: // any of the following methods:
// //
// cc.standby() // radio.standby()
// cc.sleep() // radio.sleep()
// cc.transmit(); // radio.transmit();
// cc.receive(); // radio.receive();
// cc.readData(); // radio.readData();
} }
// flag to indicate that a packet was received // flag to indicate that a packet was received
@ -106,12 +104,12 @@ void loop() {
// 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 = radio.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 = radio.readData(byteArr, 8);
*/ */
if (state == ERR_NONE) { if (state == ERR_NONE) {
@ -125,13 +123,13 @@ void loop() {
// print RSSI (Received Signal Strength Indicator) // print RSSI (Received Signal Strength Indicator)
// of the last received packet // of the last received packet
Serial.print(F("[CC1101] RSSI:\t\t")); Serial.print(F("[CC1101] RSSI:\t\t"));
Serial.print(cc.getRSSI()); Serial.print(radio.getRSSI());
Serial.println(F(" dBm")); Serial.println(F(" dBm"));
// print LQI (Link Quality Indicator) // print LQI (Link Quality Indicator)
// of the last received packet, lower is better // of the last received packet, lower is better
Serial.print(F("[CC1101] LQI:\t\t")); Serial.print(F("[CC1101] LQI:\t\t"));
Serial.println(cc.getLQI()); Serial.println(radio.getLQI());
} else if (state == ERR_CRC_MISMATCH) { } else if (state == ERR_CRC_MISMATCH) {
// packet was received, but is malformed // packet was received, but is malformed
@ -145,7 +143,7 @@ void loop() {
} }
// put module back to listen mode // put module back to listen mode
cc.startReceive(); radio.startReceive();
// we're ready to receive more packets, // we're ready to receive more packets,
// enable interrupt service routine // enable interrupt service routine

View file

@ -11,6 +11,9 @@
- output power during transmission - output power during transmission
- sync word - sync word
For default module settings, see the wiki page
https://github.com/jgromes/RadioLib/wiki/Default-configuration#cc1101
For full API reference, see the GitHub Pages For full API reference, see the GitHub Pages
https://jgromes.github.io/RadioLib/ https://jgromes.github.io/RadioLib/
*/ */
@ -23,30 +26,25 @@
// 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, RADIOLIB_NC, 3); CC1101 radio1 = 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, RADIOLIB_NC, 53); CC1101 radio2 = new Module(9, 4, RADIOLIB_NC, 53);
// or using RadioShield // or using RadioShield
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
//CC1101 cc3 = RadioShield.ModuleB; //CC1101 radio3 = RadioShield.ModuleB;
void setup() { void setup() {
Serial.begin(9600); Serial.begin(9600);
// initialize CC1101 with default settings // initialize CC1101 with default settings
Serial.print(F("[CC1101] Initializing ... ")); Serial.print(F("[CC1101] Initializing ... "));
// carrier frequency: 868.0 MHz int state = radio1.begin();
// bit rate: 4.8 kbps
// frequency deviation: 48.0 kHz
// Rx bandwidth: 325.0 kHz
// sync word: 0xD391
int state = cc1.begin();
if (state == ERR_NONE) { if (state == ERR_NONE) {
Serial.println(F("success!")); Serial.println(F("success!"));
} else { } else {
@ -62,7 +60,7 @@ void setup() {
// frequency deviation: 60.0 kHz // frequency deviation: 60.0 kHz
// Rx bandwidth: 250.0 kHz // Rx bandwidth: 250.0 kHz
// sync word: 0xD391 // sync word: 0xD391
state = cc2.begin(434.0, 32.0, 60.0, 250.0); state = radio2.begin(434.0, 32.0, 60.0, 250.0);
if (state == ERR_NONE) { if (state == ERR_NONE) {
Serial.println(F("success!")); Serial.println(F("success!"));
} else { } else {
@ -75,13 +73,13 @@ void setup() {
// and check if the configuration was changed successfully // and check if the configuration was changed successfully
// set carrier frequency to 433.5 MHz // set carrier frequency to 433.5 MHz
if (cc1.setFrequency(433.5) == ERR_INVALID_FREQUENCY) { if (radio1.setFrequency(433.5) == ERR_INVALID_FREQUENCY) {
Serial.println(F("[CC1101] Selected frequency is invalid for this module!")); Serial.println(F("[CC1101] Selected frequency is invalid for this module!"));
while (true); while (true);
} }
// set bit rate to 100.0 kbps // set bit rate to 100.0 kbps
state = cc1.setBitRate(100.0); state = radio1.setBitRate(100.0);
if (state == ERR_INVALID_BIT_RATE) { if (state == ERR_INVALID_BIT_RATE) {
Serial.println(F("[CC1101] Selected bit rate is invalid for this module!")); Serial.println(F("[CC1101] Selected bit rate is invalid for this module!"));
while (true); while (true);
@ -92,25 +90,25 @@ void setup() {
} }
// set receiver bandwidth to 250.0 kHz // set receiver bandwidth to 250.0 kHz
if (cc1.setRxBandwidth(250.0) == ERR_INVALID_RX_BANDWIDTH) { if (radio1.setRxBandwidth(250.0) == ERR_INVALID_RX_BANDWIDTH) {
Serial.println(F("[CC1101] Selected receiver bandwidth is invalid for this module!")); Serial.println(F("[CC1101] Selected receiver bandwidth is invalid for this module!"));
while (true); while (true);
} }
// set allowed frequency deviation to 10.0 kHz // set allowed frequency deviation to 10.0 kHz
if (cc1.setFrequencyDeviation(10.0) == ERR_INVALID_FREQUENCY_DEVIATION) { if (radio1.setFrequencyDeviation(10.0) == ERR_INVALID_FREQUENCY_DEVIATION) {
Serial.println(F("[CC1101] Selected frequency deviation is invalid for this module!")); Serial.println(F("[CC1101] Selected frequency deviation is invalid for this module!"));
while (true); while (true);
} }
// set output power to 5 dBm // set output power to 5 dBm
if (cc1.setOutputPower(5) == ERR_INVALID_OUTPUT_POWER) { if (radio1.setOutputPower(5) == ERR_INVALID_OUTPUT_POWER) {
Serial.println(F("[CC1101] Selected output power is invalid for this module!")); Serial.println(F("[CC1101] Selected output power is invalid for this module!"));
while (true); while (true);
} }
// 2 bytes can be set as sync word // 2 bytes can be set as sync word
if (cc1.setSyncWord(0x01, 0x23) == ERR_INVALID_SYNC_WORD) { if (radio1.setSyncWord(0x01, 0x23) == ERR_INVALID_SYNC_WORD) {
Serial.println(F("[CC1101] Selected sync word is invalid for this module!")); Serial.println(F("[CC1101] Selected sync word is invalid for this module!"));
while (true); while (true);
} }

View file

@ -7,6 +7,9 @@
- null-terminated char array (C-string) - null-terminated char array (C-string)
- arbitrary binary data (byte array) - arbitrary binary data (byte array)
For default module settings, see the wiki page
https://github.com/jgromes/RadioLib/wiki/Default-configuration#cc1101
For full API reference, see the GitHub Pages For full API reference, see the GitHub Pages
https://jgromes.github.io/RadioLib/ https://jgromes.github.io/RadioLib/
*/ */
@ -19,23 +22,18 @@
// 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, RADIOLIB_NC, 3); CC1101 radio = new Module(10, 2, RADIOLIB_NC, 3);
// or using RadioShield // or using RadioShield
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
//CC1101 cc = RadioShield.ModuleA; //CC1101 radio = RadioShield.ModuleA;
void setup() { void setup() {
Serial.begin(9600); Serial.begin(9600);
// initialize CC1101 // initialize CC1101 with default settings
Serial.print(F("[CC1101] Initializing ... ")); Serial.print(F("[CC1101] Initializing ... "));
// carrier frequency: 868.0 MHz int state = radio.begin();
// bit rate: 4.8 kbps
// frequency deviation: 48.0 kHz
// Rx bandwidth: 325.0 kHz
// sync word: 0xD391
int state = cc.begin();
if (state == ERR_NONE) { if (state == ERR_NONE) {
Serial.println(F("success!")); Serial.println(F("success!"));
} else { } else {
@ -49,12 +47,12 @@ void loop() {
Serial.print(F("[CC1101] Transmitting packet ... ")); Serial.print(F("[CC1101] Transmitting packet ... "));
// you can transmit C-string or Arduino string up to 63 characters long // you can transmit C-string or Arduino string up to 63 characters long
int state = cc.transmit("Hello World!"); int state = radio.transmit("Hello World!");
// you can also transmit byte array up to 63 bytes long // you can also transmit byte array up to 63 bytes long
/* /*
byte byteArr[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF}; byte byteArr[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
int state = cc.transmit(byteArr, 8); int state = radio.transmit(byteArr, 8);
*/ */
if (state == ERR_NONE) { if (state == ERR_NONE) {

View file

@ -7,6 +7,9 @@
will automatically filter out any packets that do not will automatically filter out any packets that do not
contain either node address or broadcast addresses. contain either node address or broadcast addresses.
For default module settings, see the wiki page
https://github.com/jgromes/RadioLib/wiki/Default-configuration#cc1101
For full API reference, see the GitHub Pages For full API reference, see the GitHub Pages
https://jgromes.github.io/RadioLib/ https://jgromes.github.io/RadioLib/
*/ */
@ -19,23 +22,18 @@
// 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, RADIOLIB_NC, 3); CC1101 radio = new Module(10, 2, RADIOLIB_NC, 3);
// or using RadioShield // or using RadioShield
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
//CC1101 cc = RadioShield.ModuleA; //CC1101 radio = RadioShield.ModuleA;
void setup() { void setup() {
Serial.begin(9600); Serial.begin(9600);
// initialize CC1101 with default settings // initialize CC1101 with default settings
Serial.print(F("[CC1101] Initializing ... ")); Serial.print(F("[CC1101] Initializing ... "));
// carrier frequency: 868.0 MHz int state = radio.begin();
// bit rate: 4.8 kbps
// frequency deviation: 48.0 kHz
// Rx bandwidth: 325.0 kHz
// sync word: 0xD391
int state = cc.begin();
if (state == ERR_NONE) { if (state == ERR_NONE) {
Serial.println(F("success!")); Serial.println(F("success!"));
} else { } else {
@ -52,7 +50,7 @@ void setup() {
// When setting two broadcast addresses, 0x00 and // When setting two broadcast addresses, 0x00 and
// 0xFF will be used. // 0xFF will be used.
Serial.print(F("[CC1101] Setting node address ... ")); Serial.print(F("[CC1101] Setting node address ... "));
state = cc.setNodeAddress(0x01, 1); state = radio.setNodeAddress(0x01, 1);
if (state == ERR_NONE) { if (state == ERR_NONE) {
Serial.println(F("success!")); Serial.println(F("success!"));
} else { } else {
@ -66,7 +64,7 @@ void setup() {
// set node address // set node address
/* /*
Serial.print(F("[CC1101] Disabling address filtering ... ")); Serial.print(F("[CC1101] Disabling address filtering ... "));
state == cc.disableAddressFiltering(); state == radio.disableAddressFiltering();
if(state == ERR_NONE) { if(state == ERR_NONE) {
Serial.println(F("success!")); Serial.println(F("success!"));
} else { } else {
@ -81,12 +79,12 @@ void loop() {
Serial.print(F("[CC1101] Transmitting packet ... ")); Serial.print(F("[CC1101] Transmitting packet ... "));
// you can transmit C-string or Arduino string up to 63 characters long // you can transmit C-string or Arduino string up to 63 characters long
int state = cc.transmit("Hello World!"); int state = radio.transmit("Hello World!");
// you can also transmit byte array up to 63 bytes long // you can also transmit byte array up to 63 bytes long
/* /*
byte byteArr[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF}; byte byteArr[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
int state = cc.transmit(byteArr, 8); int state = radio.transmit(byteArr, 8);
*/ */
if (state == ERR_NONE) { if (state == ERR_NONE) {

View file

@ -8,6 +8,9 @@
- null-terminated char array (C-string) - null-terminated char array (C-string)
- arbitrary binary data (byte array) - arbitrary binary data (byte array)
For default module settings, see the wiki page
https://github.com/jgromes/RadioLib/wiki/Default-configuration#cc1101
For full API reference, see the GitHub Pages For full API reference, see the GitHub Pages
https://jgromes.github.io/RadioLib/ https://jgromes.github.io/RadioLib/
*/ */
@ -20,11 +23,11 @@
// 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, RADIOLIB_NC, 3); CC1101 radio = new Module(10, 2, RADIOLIB_NC, 3);
// or using RadioShield // or using RadioShield
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
//CC1101 cc = RadioShield.ModuleA; //CC1101 radio = RadioShield.ModuleA;
// save transmission state between loops // save transmission state between loops
int transmissionState = ERR_NONE; int transmissionState = ERR_NONE;
@ -34,12 +37,7 @@ void setup() {
// initialize CC1101 with default settings // initialize CC1101 with default settings
Serial.print(F("[CC1101] Initializing ... ")); Serial.print(F("[CC1101] Initializing ... "));
// carrier frequency: 868.0 MHz int state = radio.begin();
// bit rate: 4.8 kbps
// frequency deviation: 48.0 kHz
// Rx bandwidth: 325.0 kHz
// sync word: 0xD391
int state = cc.begin();
if (state == ERR_NONE) { if (state == ERR_NONE) {
Serial.println(F("success!")); Serial.println(F("success!"));
} else { } else {
@ -50,20 +48,20 @@ void setup() {
// set the function that will be called // set the function that will be called
// when packet transmission is finished // when packet transmission is finished
cc.setGdo0Action(setFlag); radio.setGdo0Action(setFlag);
// start transmitting the first packet // start transmitting the first packet
Serial.print(F("[CC1101] Sending first packet ... ")); Serial.print(F("[CC1101] Sending first packet ... "));
// you can transmit C-string or Arduino string up to // you can transmit C-string or Arduino string up to
// 64 characters long // 64 characters long
transmissionState = cc.startTransmit("Hello World!"); transmissionState = radio.startTransmit("Hello World!");
// you can also transmit byte array up to 64 bytes long // you can also transmit byte array up to 64 bytes long
/* /*
byte byteArr[] = {0x01, 0x23, 0x45, 0x56, byte byteArr[] = {0x01, 0x23, 0x45, 0x56,
0x78, 0xAB, 0xCD, 0xEF}; 0x78, 0xAB, 0xCD, 0xEF};
state = cc.startTransmit(byteArr, 8); state = radio.startTransmit(byteArr, 8);
*/ */
} }
@ -119,13 +117,13 @@ void loop() {
// you can transmit C-string or Arduino string up to // you can transmit C-string or Arduino string up to
// 256 characters long // 256 characters long
transmissionState = cc.startTransmit("Hello World!"); transmissionState = radio.startTransmit("Hello World!");
// you can also transmit byte array up to 256 bytes long // you can also transmit byte array up to 256 bytes long
/* /*
byte byteArr[] = {0x01, 0x23, 0x45, 0x67, byte byteArr[] = {0x01, 0x23, 0x45, 0x67,
0x89, 0xAB, 0xCD, 0xEF}; 0x89, 0xAB, 0xCD, 0xEF};
int state = cc.startTransmit(byteArr, 8); int state = radio.startTransmit(byteArr, 8);
*/ */
// we're ready to send more packets, // we're ready to send more packets,