[SX1231] Added links to default config wiki page

This commit is contained in:
jgromes 2020-07-04 12:03:26 +02:00
parent ffe535c873
commit 305e187bfe
2 changed files with 16 additions and 22 deletions

View file

@ -7,6 +7,9 @@
interface. Please see RF69 examples for examples on AES, interface. Please see RF69 examples for examples on AES,
address filtering, interrupts and settings. address filtering, interrupts and settings.
For default module settings, see the wiki page
https://github.com/jgromes/RadioLib/wiki/Default-configuration#rf69sx1231
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/
*/ */
@ -18,24 +21,18 @@
// CS pin: 10 // CS pin: 10
// DIO0 pin: 2 // DIO0 pin: 2
// RESET pin: 3 // RESET pin: 3
SX1231 rf = new Module(10, 2, 3); SX1231 radio = new Module(10, 2, 3);
// or using RadioShield // or using RadioShield
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
//SX1231 rf = RadioShield.ModuleA; //SX1231 radio = RadioShield.ModuleA;
void setup() { void setup() {
Serial.begin(9600); Serial.begin(9600);
// initialize SX1231 with default settings // initialize SX1231 with default settings
Serial.print(F("[SX1231] Initializing ... ")); Serial.print(F("[SX1231] Initializing ... "));
// carrier frequency: 434.0 MHz int state = radio.begin();
// bit rate: 48.0 kbps
// Rx bandwidth: 125.0 kHz
// frequency deviation: 50.0 kHz
// output power: 13 dBm
// sync word: 0x2D01
int state = rf.begin();
if (state == ERR_NONE) { if (state == ERR_NONE) {
Serial.println(F("success!")); Serial.println(F("success!"));
} else { } else {
@ -50,12 +47,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 = rf.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 = rf.receive(byteArr, 8); int state = radio.receive(byteArr, 8);
*/ */
if (state == ERR_NONE) { if (state == ERR_NONE) {

View file

@ -7,6 +7,9 @@
interface. Please see RF69 examples for examples on AES, interface. Please see RF69 examples for examples on AES,
address filtering, interrupts and settings. address filtering, interrupts and settings.
For default module settings, see the wiki page
https://github.com/jgromes/RadioLib/wiki/Default-configuration#rf69sx1231
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/
*/ */
@ -18,24 +21,18 @@
// CS pin: 10 // CS pin: 10
// DIO0 pin: 2 // DIO0 pin: 2
// RESET pin: 3 // RESET pin: 3
SX1231 rf = new Module(10, 2, 3); SX1231 radio = new Module(10, 2, 3);
// or using RadioShield // or using RadioShield
// https://github.com/jgromes/RadioShield // https://github.com/jgromes/RadioShield
//SX1231 rf = RadioShield.ModuleA; //SX1231 radio = RadioShield.ModuleA;
void setup() { void setup() {
Serial.begin(9600); Serial.begin(9600);
// initialize SX1231 with default settings // initialize SX1231 with default settings
Serial.print(F("[SX1231] Initializing ... ")); Serial.print(F("[SX1231] Initializing ... "));
// carrier frequency: 434.0 MHz int state = radio.begin();
// bit rate: 48.0 kbps
// Rx bandwidth: 125.0 kHz
// frequency deviation: 50.0 kHz
// output power: 13 dBm
// sync word: 0x2D01
int state = rf.begin();
if (state == ERR_NONE) { if (state == ERR_NONE) {
Serial.println(F("success!")); Serial.println(F("success!"));
} else { } else {
@ -49,12 +46,12 @@ void loop() {
Serial.print(F("[SX1231] Transmitting packet ... ")); Serial.print(F("[SX1231] Transmitting packet ... "));
// you can transmit C-string or Arduino string up to 256 characters long // you can transmit C-string or Arduino string up to 256 characters long
int state = rf.transmit("Hello World!"); int state = radio.transmit("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, 0x89, 0xAB, 0xCD, 0xEF}; byte byteArr[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
int state = rf.transmit(byteArr, 8); int state = radio.transmit(byteArr, 8);
*/ */
if (state == ERR_NONE) { if (state == ERR_NONE) {