[SX126x] Fixed typos in examples
This commit is contained in:
parent
88d58e52d7
commit
0bafe185a9
5 changed files with 40 additions and 35 deletions
|
@ -65,20 +65,20 @@ void loop() {
|
||||||
Serial.println(F("success!"));
|
Serial.println(F("success!"));
|
||||||
|
|
||||||
// print the data of the packet
|
// print the data of the packet
|
||||||
Serial.print("[SX1262] Data:\t\t");
|
Serial.print(F("[SX1262] Data:\t\t"));
|
||||||
Serial.println(str);
|
Serial.println(str);
|
||||||
|
|
||||||
// print the RSSI (Received Signal Strength Indicator)
|
// print the RSSI (Received Signal Strength Indicator)
|
||||||
// of the last received packet
|
// of the last received packet
|
||||||
Serial.print("[SX1262] RSSI:\t\t");
|
Serial.print(F("[SX1262] RSSI:\t\t"));
|
||||||
Serial.print(lora.getRSSI());
|
Serial.print(lora.getRSSI());
|
||||||
Serial.println(" dBm");
|
Serial.println(F(" dBm"));
|
||||||
|
|
||||||
// print the SNR (Signal-to-Noise Ratio)
|
// print the SNR (Signal-to-Noise Ratio)
|
||||||
// of the last received packet
|
// of the last received packet
|
||||||
Serial.print("[SX1262] SNR:\t\t");
|
Serial.print(F("[SX1262] SNR:\t\t"));
|
||||||
Serial.print(lora.getSNR());
|
Serial.print(lora.getSNR());
|
||||||
Serial.println(" dBm");
|
Serial.println(F(" dBm"));
|
||||||
|
|
||||||
} else if (state == ERR_RX_TIMEOUT) {
|
} else if (state == ERR_RX_TIMEOUT) {
|
||||||
// timeout occurred while waiting for a packet
|
// timeout occurred while waiting for a packet
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
RadioLib SX126x Receive with Inerrupts Example
|
RadioLib SX126x Receive with Interrupts Example
|
||||||
|
|
||||||
This example listens for LoRa transmissions and tries to
|
This example listens for LoRa transmissions and tries to
|
||||||
receive them. Once a packet is received, an interrupt is
|
receive them. Once a packet is received, an interrupt is
|
||||||
|
@ -120,7 +120,7 @@ void loop() {
|
||||||
// print RSSI (Received Signal Strength Indicator)
|
// print RSSI (Received Signal Strength Indicator)
|
||||||
Serial.print(F("[SX1262] RSSI:\t\t"));
|
Serial.print(F("[SX1262] RSSI:\t\t"));
|
||||||
Serial.print(lora.getRSSI());
|
Serial.print(lora.getRSSI());
|
||||||
Serial.println(" dBm");
|
Serial.println(F(" dBm"));
|
||||||
|
|
||||||
// print SNR (Signal-to-Noise Ratio)
|
// print SNR (Signal-to-Noise Ratio)
|
||||||
Serial.print(F("[SX1262] SNR:\t\t"));
|
Serial.print(F("[SX1262] SNR:\t\t"));
|
||||||
|
|
|
@ -23,8 +23,13 @@
|
||||||
// SX1268 module is in slot A on the shield
|
// SX1268 module is in slot A on the shield
|
||||||
SX1268 loraSX1268 = RadioShield.ModuleA;
|
SX1268 loraSX1268 = RadioShield.ModuleA;
|
||||||
|
|
||||||
// SX1262 module is in slot B on the shield
|
// if you're not using RadioShield, you can specify
|
||||||
SX1262 loraSX1262 = RadioShield.ModuleB;
|
// the connection yourself
|
||||||
|
// NSS pin: 6
|
||||||
|
// DIO1 pin: 4
|
||||||
|
// DIO2 pin: 5
|
||||||
|
// BUSY pin: 7
|
||||||
|
SX1262 loraSX1262 = new Module(6, 4, 5, 7);
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
@ -130,7 +135,7 @@ void setup() {
|
||||||
while (true);
|
while (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some SX126x have TCXO (temprature compensated crystal
|
// Some SX126x have TCXO (temperature compensated crystal
|
||||||
// oscillator). To configure TCXO reference voltage,
|
// oscillator). To configure TCXO reference voltage,
|
||||||
// the following method can be used.
|
// the following method can be used.
|
||||||
if (loraSX1268.setTCXO(2.4) == ERR_INVALID_TCXO_VOLTAGE) {
|
if (loraSX1268.setTCXO(2.4) == ERR_INVALID_TCXO_VOLTAGE) {
|
||||||
|
|
|
@ -58,20 +58,20 @@ void loop() {
|
||||||
|
|
||||||
if (state == ERR_NONE) {
|
if (state == ERR_NONE) {
|
||||||
// the packet was successfully transmitted
|
// the packet was successfully transmitted
|
||||||
Serial.println(" success!");
|
Serial.println(F(" success!"));
|
||||||
|
|
||||||
// print measured data rate
|
// print measured data rate
|
||||||
Serial.print("[SX1262] Datarate:\t");
|
Serial.print(F("[SX1262] Datarate:\t"));
|
||||||
Serial.print(lora.getDataRate());
|
Serial.print(lora.getDataRate());
|
||||||
Serial.println(" bps");
|
Serial.println(F(" bps"));
|
||||||
|
|
||||||
} else if (state == ERR_PACKET_TOO_LONG) {
|
} else if (state == ERR_PACKET_TOO_LONG) {
|
||||||
// the supplied packet was longer than 256 bytes
|
// the supplied packet was longer than 256 bytes
|
||||||
Serial.println(" too long!");
|
Serial.println(F(" too long!"));
|
||||||
|
|
||||||
} else if (state == ERR_TX_TIMEOUT) {
|
} else if (state == ERR_TX_TIMEOUT) {
|
||||||
// timeout occured while transmitting packet
|
// timeout occured while transmitting packet
|
||||||
Serial.println(" timeout!");
|
Serial.println(F(" timeout!"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
RadioLib SX126x Transmit with Inerrupts Example
|
RadioLib SX126x Transmit with Interrupts Example
|
||||||
|
|
||||||
This example transmits LoRa packets with one second delays
|
This example transmits LoRa packets with one second delays
|
||||||
between them. Each packet contains up to 256 bytes
|
between them. Each packet contains up to 256 bytes
|
||||||
|
|
Loading…
Add table
Reference in a new issue