[SX127x] Added reset to home channel to FHSS examples ()

This commit is contained in:
jgromes 2024-10-20 14:25:27 +01:00
parent 4a155b1922
commit cc720a7a24
2 changed files with 6 additions and 1 deletions
examples/SX127x
SX127x_Receive_FHSS
SX127x_Transmit_FHSS

View file

@ -86,6 +86,7 @@ void setup() {
// set hop period in symbols
// this will also enable FHSS
Serial.print(F("[SX1278] Setting hopping period ... "));
state = radio.setFHSSHoppingPeriod(9);
if (state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
@ -153,6 +154,9 @@ void loop() {
// reset the counter
hopsCompleted = 0;
// return to home channel before the next transaction
radio.setFrequency(channels[0]);
// put the module back to listen mode
radio.startReceive();

View file

@ -98,6 +98,7 @@ void setup() {
// set hop period in symbols
// this will also enable FHSS
Serial.print(F("[SX1278] Setting hopping period ... "));
state = radio.setFHSSHoppingPeriod(9);
if (state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
@ -147,7 +148,7 @@ void loop() {
hopsCompleted = 0;
// return to home channel before the next transaction
radio.setFrequency(channels[radio.getFHSSChannel() % numberOfChannels]);
radio.setFrequency(channels[0]);
// wait a second before transmitting again
delay(1000);