[RF69] Added delay to halting while loops

This commit is contained in:
jgromes 2024-06-29 18:32:30 +02:00
parent ff5b7117bf
commit d99dd952df
9 changed files with 27 additions and 27 deletions

View file

@ -36,7 +36,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// set AES key that will be used to decrypt the packet

View file

@ -38,7 +38,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// set node address
@ -51,7 +51,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// set broadcast address
@ -64,7 +64,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// address filtering can also be disabled
@ -78,7 +78,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while(true);
while (true) { delay(10); }
}
*/
}

View file

@ -45,7 +45,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
}

View file

@ -36,7 +36,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// set the function that will be called
@ -51,7 +51,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// if needed, 'listen' mode can be disabled by calling

View file

@ -48,7 +48,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// initialize RF69 with non-default settings
@ -65,7 +65,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// you can also change the settings at runtime
@ -74,41 +74,41 @@ void setup() {
// set carrier frequency to 433.5 MHz
if (radio1.setFrequency(433.5) == RADIOLIB_ERR_INVALID_FREQUENCY) {
Serial.println(F("[RF69] Selected frequency is invalid for this module!"));
while (true);
while (true) { delay(10); }
}
// set bit rate to 100.0 kbps
state = radio1.setBitRate(100.0);
if (state == RADIOLIB_ERR_INVALID_BIT_RATE) {
Serial.println(F("[RF69] Selected bit rate is invalid for this module!"));
while (true);
while (true) { delay(10); }
} else if (state == RADIOLIB_ERR_INVALID_BIT_RATE_BW_RATIO) {
Serial.println(F("[RF69] Selected bit rate to bandwidth ratio is invalid!"));
Serial.println(F("[RF69] Increase receiver bandwidth to set this bit rate."));
while (true);
while (true) { delay(10); }
}
// set receiver bandwidth to 250.0 kHz
state = radio1.setRxBandwidth(250.0);
if (state == RADIOLIB_ERR_INVALID_RX_BANDWIDTH) {
Serial.println(F("[RF69] Selected receiver bandwidth is invalid for this module!"));
while (true);
while (true) { delay(10); }
} else if (state == RADIOLIB_ERR_INVALID_BIT_RATE_BW_RATIO) {
Serial.println(F("[RF69] Selected bit rate to bandwidth ratio is invalid!"));
Serial.println(F("[RF69] Decrease bit rate to set this receiver bandwidth."));
while (true);
while (true) { delay(10); }
}
// set allowed frequency deviation to 10.0 kHz
if (radio1.setFrequencyDeviation(10.0) == RADIOLIB_ERR_INVALID_FREQUENCY_DEVIATION) {
Serial.println(F("[RF69] Selected frequency deviation is invalid for this module!"));
while (true);
while (true) { delay(10); }
}
// set output power to 2 dBm
if (radio1.setOutputPower(2) == RADIOLIB_ERR_INVALID_OUTPUT_POWER) {
Serial.println(F("[RF69] Selected output power is invalid for this module!"));
while (true);
while (true) { delay(10); }
}
// up to 8 bytes can be set as sync word
@ -117,7 +117,7 @@ void setup() {
uint8_t syncWord[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
if (radio1.setSyncWord(syncWord, 8) == RADIOLIB_ERR_INVALID_SYNC_WORD) {
Serial.println(F("[RF69] Selected sync word is invalid for this module!"));
while (true);
while (true) { delay(10); }
}
Serial.println(F("[RF69] All settings changed successfully!"));

View file

@ -36,7 +36,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// set AES key to encrypt the packet

View file

@ -38,7 +38,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// set node address
@ -51,7 +51,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// set broadcast address
@ -64,7 +64,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// address filtering can also be disabled
@ -78,7 +78,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while(true);
while (true) { delay(10); }
}
*/
}

View file

@ -42,7 +42,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// NOTE: some RF69 modules use high power output,
@ -58,7 +58,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
*/
}

View file

@ -42,7 +42,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// set the function that will be called
@ -62,7 +62,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
*/