[Morse] Reworked example naming

pull/554/head
jgromes 2022-07-30 08:51:44 +02:00
rodzic 356f1ef2fd
commit 7735cffb62
2 zmienionych plików z 20 dodań i 8 usunięć

Wyświetl plik

@ -2,8 +2,8 @@
RadioLib Morse Transmit AFSK Example
This example sends Morse code message using
SX1278's FSK modem. The data is modulated
as AFSK.
SX1278's FSK modem. The signal is modulated
as AFSK, and may be demodulated in FM mode.
Other modules that can be used for Morse Code
with AFSK modulation:
@ -28,7 +28,7 @@
// DIO0 pin: 2
// RESET pin: 9
// DIO1 pin: 3
SX1278 radio = new Module(10, 2, 9, 3);
SX1278 radio = new Module(5, 2, 9, 3);
// or using RadioShield
// https://github.com/jgromes/RadioShield
@ -36,7 +36,7 @@ SX1278 radio = new Module(10, 2, 9, 3);
// create AFSK client instance using the FSK module
// pin 5 is connected to SX1278 DIO2
AFSKClient audio(&radio, 5);
AFSKClient audio(&radio, 10);
// create Morse client instance using the AFSK instance
MorseClient morse(&audio);
@ -62,7 +62,7 @@ void setup() {
// initialize Morse client
Serial.print(F("[Morse] Initializing ... "));
// AFSK tone frequency: 400 MHz
// tone frequency: 400 Hz
// speed: 20 words per minute
state = morse.begin(400);
if(state == RADIOLIB_ERR_NONE) {
@ -72,6 +72,17 @@ void setup() {
Serial.println(state);
while(true);
}
// after that, set mode to OOK
Serial.print(F("[SX1278] Switching to OOK ... "));
state = radio.setOOK(true);
if(state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while(true);
}
}
void loop() {

Wyświetl plik

@ -1,8 +1,9 @@
/*
RadioLib Morse Transmit Example
RadioLib Morse Transmit SSB Example
This example sends Morse code message using
SX1278's FSK modem.
SX1278's FSK modem. The signal is an unmodulated
carrier wave, and may be demodulated in SSB mode.
Other modules that can be used for Morse Code:
- SX127x/RFM9x
@ -59,7 +60,7 @@ void setup() {
// initialize Morse client
Serial.print(F("[Morse] Initializing ... "));
// base frequency: 434.0 MHz
// carrier wave frequency: 434.0 MHz
// speed: 20 words per minute
state = morse.begin(434.0);
if(state == RADIOLIB_ERR_NONE) {