From 076b111e6cc80764effb4d0e357062fe31df4398 Mon Sep 17 00:00:00 2001 From: jgromes Date: Sun, 2 Jun 2019 15:03:10 +0200 Subject: [PATCH] [SX1231] Updated examples --- .../SX1231/SX1231_Receive/SX1231_Receive.ino | 19 +++++++++++++++++-- .../SX1231_Transmit/SX1231_Transmit.ino | 14 ++++++++++++-- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/examples/SX1231/SX1231_Receive/SX1231_Receive.ino b/examples/SX1231/SX1231_Receive/SX1231_Receive.ino index 42af27e8..8de99947 100644 --- a/examples/SX1231/SX1231_Receive/SX1231_Receive.ino +++ b/examples/SX1231/SX1231_Receive/SX1231_Receive.ino @@ -6,13 +6,23 @@ NOTE: SX1231 offers the same features as RF69 and has the same interface. Please see RF69 examples for examples on AES, address filtering, interrupts and settings. + + For full API reference, see the GitHub Pages + https://jgromes.github.io/RadioLib/ */ // include the library #include -// SX1231 module is in slot A on the shield -SX1231 rf = RadioShield.ModuleA; +// SX1231 has the following connections: +// NSS pin: 10 +// DIO0 pin: 2 +// DIO1 pin: 3 +SX1231 rf = new Module(10, 2, 3); + +// or using RadioShield +// https://github.com/jgromes/RadioShield +//SX1231 rf = RadioShield.ModuleA; void setup() { Serial.begin(9600); @@ -64,5 +74,10 @@ void loop() { // packet was received, but is malformed Serial.println(F("CRC error!")); + } else { + // some other error occurred + Serial.print(F("failed, code ")); + Serial.println(state); + } } diff --git a/examples/SX1231/SX1231_Transmit/SX1231_Transmit.ino b/examples/SX1231/SX1231_Transmit/SX1231_Transmit.ino index 6fbc5f06..b3376f2d 100644 --- a/examples/SX1231/SX1231_Transmit/SX1231_Transmit.ino +++ b/examples/SX1231/SX1231_Transmit/SX1231_Transmit.ino @@ -6,13 +6,23 @@ NOTE: SX1231 offers the same features as RF69 and has the same interface. Please see RF69 examples for examples on AES, address filtering, interrupts and settings. + + For full API reference, see the GitHub Pages + https://jgromes.github.io/RadioLib/ */ // include the library #include -// SX1231 module is in slot A on the shield -SX1231 rf = RadioShield.ModuleA; +// SX1231 has the following connections: +// NSS pin: 10 +// DIO0 pin: 2 +// DIO1 pin: 3 +SX1231 rf = new Module(10, 2, 3); + +// or using RadioShield +// https://github.com/jgromes/RadioShield +//SX1231 rf = RadioShield.ModuleA; void setup() { Serial.begin(9600);