From 8deec71b6f1db3b1eb3ff559a3b0a13d1a6b917f Mon Sep 17 00:00:00 2001 From: jgromes Date: Sun, 14 Nov 2021 12:36:00 +0100 Subject: [PATCH] Use Arduino tone/noTone --- examples/SX127x/SX127x_FSK_Modem/SX127x_FSK_Modem.ino | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/SX127x/SX127x_FSK_Modem/SX127x_FSK_Modem.ino b/examples/SX127x/SX127x_FSK_Modem/SX127x_FSK_Modem.ino index f6328172..caf4fe4a 100644 --- a/examples/SX127x/SX127x_FSK_Modem/SX127x_FSK_Modem.ino +++ b/examples/SX127x/SX127x_FSK_Modem/SX127x_FSK_Modem.ino @@ -175,15 +175,17 @@ void loop() { Serial.println(state); } - // transmit FM tone at 1000 Hz for 1 second + // transmit FM tone at 1000 Hz for 1 second, then 500 Hz for 1 second // (DIO2 is connected to Arduino pin 4) // Note: tone() function is not available on ESP32, Arduino Due and CubeCell // on these platforms, the following will do nothing - Module::tone(4, 1000); + #if !defined(RADIOLIB_TONE_UNSUPPORTED) + tone(4, 1000); delay(1000); - // transmit FM note at 500 Hz for 1 second - Module::tone(4, 500); + tone(4, 500); delay(1000); + noTone(4); + #endif // NOTE: after calling transmitDirect(), SX127x will start // transmitting immediately! This signal can jam other