[CC1101] Changed pin mapping
This commit is contained in:
parent
0bc7208827
commit
9e2ed2ca6f
3 changed files with 8 additions and 6 deletions
|
@ -15,9 +15,9 @@
|
||||||
#include <RadioLib.h>
|
#include <RadioLib.h>
|
||||||
|
|
||||||
// SX1231 has the following connections:
|
// SX1231 has the following connections:
|
||||||
// NSS pin: 10
|
// CS pin: 10
|
||||||
// DIO0 pin: 2
|
// DIO0 pin: 2
|
||||||
// DIO1 pin: 3
|
// RESET pin: 3
|
||||||
SX1231 rf = new Module(10, 2, 3);
|
SX1231 rf = new Module(10, 2, 3);
|
||||||
|
|
||||||
// or using RadioShield
|
// or using RadioShield
|
||||||
|
@ -35,7 +35,7 @@ void setup() {
|
||||||
// frequency deviation: 50.0 kHz
|
// frequency deviation: 50.0 kHz
|
||||||
// output power: 13 dBm
|
// output power: 13 dBm
|
||||||
// sync word: 0x2D01
|
// sync word: 0x2D01
|
||||||
byte state = rf.begin();
|
int state = rf.begin();
|
||||||
if (state == ERR_NONE) {
|
if (state == ERR_NONE) {
|
||||||
Serial.println(F("success!"));
|
Serial.println(F("success!"));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
#include <RadioLib.h>
|
#include <RadioLib.h>
|
||||||
|
|
||||||
// SX1231 has the following connections:
|
// SX1231 has the following connections:
|
||||||
// NSS pin: 10
|
// CS pin: 10
|
||||||
// DIO0 pin: 2
|
// DIO0 pin: 2
|
||||||
// DIO1 pin: 3
|
// RESET pin: 3
|
||||||
SX1231 rf = new Module(10, 2, 3);
|
SX1231 rf = new Module(10, 2, 3);
|
||||||
|
|
||||||
// or using RadioShield
|
// or using RadioShield
|
||||||
|
|
|
@ -6,7 +6,9 @@ SX1231::SX1231(Module* mod) : RF69(mod) {
|
||||||
|
|
||||||
int16_t SX1231::begin(float freq, float br, float rxBw, float freqDev, int8_t power) {
|
int16_t SX1231::begin(float freq, float br, float rxBw, float freqDev, int8_t power) {
|
||||||
// set module properties
|
// set module properties
|
||||||
_mod->init(RADIOLIB_USE_SPI, RADIOLIB_INT_BOTH);
|
_mod->init(RADIOLIB_USE_SPI);
|
||||||
|
Module::pinMode(_mod->getIrq(), INPUT);
|
||||||
|
Module::pinMode(_mod->getRst(), OUTPUT);
|
||||||
|
|
||||||
// try to find the SX1231 chip
|
// try to find the SX1231 chip
|
||||||
uint8_t i = 0;
|
uint8_t i = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue