Skip to content

Commit 1ac3e92

Browse files
committed
Repair example #256
1 parent bdd534b commit 1ac3e92

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

examples/radio/SX1262/SX126x_Receive/SX126x_Receive.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ void setup()
4545
while (true);
4646
}
4747

48-
// set carrier frequency to 433.5 MHz
49-
if (radio.setFrequency(433.5) == RADIOLIB_ERR_INVALID_FREQUENCY) {
48+
// set carrier frequency to 868.0 MHz
49+
if (radio.setFrequency(868.0) == RADIOLIB_ERR_INVALID_FREQUENCY) {
5050
Serial.println(F("Selected frequency is invalid for this module!"));
5151
while (true);
5252
}
@@ -102,6 +102,7 @@ void loop()
102102
Serial.print(radio.getFrequencyError());
103103
Serial.println(F(" Hz"));
104104

105+
lv_label_set_text_fmt(label1, "Recv :%s\nRSSI:%.2fdBm\nSNR:%.2f", str.c_str(), radio.getRSSI(), radio.getSNR());
105106

106107
} else if (state == RADIOLIB_ERR_RX_TIMEOUT) {
107108
// timeout occurred while waiting for a packet

examples/radio/SX1262/SX126x_Transmit/SX126x_Transmit.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ void setup()
3030

3131
watch.begin();
3232

33-
// set carrier frequency to 433.5 MHz
34-
if (radio.setFrequency(433.5) == RADIOLIB_ERR_INVALID_FREQUENCY) {
35-
Serial.println(F("Selected frequency is invalid for this module!"));
36-
while (true);
37-
}
38-
3933
beginLvglHelper();
4034

4135
// initialize SX1262 with default settings
@@ -49,6 +43,12 @@ void setup()
4943
while (true);
5044
}
5145

46+
// set carrier frequency to 868.0 MHz
47+
if (radio.setFrequency(868.0) == RADIOLIB_ERR_INVALID_FREQUENCY) {
48+
Serial.println(F("Selected frequency is invalid for this module!"));
49+
while (true);
50+
}
51+
5252
label1 = lv_label_create(lv_scr_act());
5353
lv_label_set_recolor(label1, true); /*Enable re-coloring by commands in the text*/
5454
lv_label_set_text(label1, "SX126x_Transmit");

0 commit comments

Comments
 (0)