[Morse] Reworked example naming
This commit is contained in:
parent
356f1ef2fd
commit
7735cffb62
2 changed files with 20 additions and 8 deletions
|
@ -2,8 +2,8 @@
|
||||||
RadioLib Morse Transmit AFSK Example
|
RadioLib Morse Transmit AFSK Example
|
||||||
|
|
||||||
This example sends Morse code message using
|
This example sends Morse code message using
|
||||||
SX1278's FSK modem. The data is modulated
|
SX1278's FSK modem. The signal is modulated
|
||||||
as AFSK.
|
as AFSK, and may be demodulated in FM mode.
|
||||||
|
|
||||||
Other modules that can be used for Morse Code
|
Other modules that can be used for Morse Code
|
||||||
with AFSK modulation:
|
with AFSK modulation:
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
// DIO0 pin: 2
|
// DIO0 pin: 2
|
||||||
// RESET pin: 9
|
// RESET pin: 9
|
||||||
// DIO1 pin: 3
|
// DIO1 pin: 3
|
||||||
SX1278 radio = new Module(10, 2, 9, 3);
|
SX1278 radio = new Module(5, 2, 9, 3);
|
||||||
|
|
||||||
// or using RadioShield
|
// or using RadioShield
|
||||||
// https://github.com/jgromes/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
|
// create AFSK client instance using the FSK module
|
||||||
// pin 5 is connected to SX1278 DIO2
|
// pin 5 is connected to SX1278 DIO2
|
||||||
AFSKClient audio(&radio, 5);
|
AFSKClient audio(&radio, 10);
|
||||||
|
|
||||||
// create Morse client instance using the AFSK instance
|
// create Morse client instance using the AFSK instance
|
||||||
MorseClient morse(&audio);
|
MorseClient morse(&audio);
|
||||||
|
@ -62,7 +62,7 @@ void setup() {
|
||||||
|
|
||||||
// initialize Morse client
|
// initialize Morse client
|
||||||
Serial.print(F("[Morse] Initializing ... "));
|
Serial.print(F("[Morse] Initializing ... "));
|
||||||
// AFSK tone frequency: 400 MHz
|
// tone frequency: 400 Hz
|
||||||
// speed: 20 words per minute
|
// speed: 20 words per minute
|
||||||
state = morse.begin(400);
|
state = morse.begin(400);
|
||||||
if(state == RADIOLIB_ERR_NONE) {
|
if(state == RADIOLIB_ERR_NONE) {
|
||||||
|
@ -72,6 +72,17 @@ void setup() {
|
||||||
Serial.println(state);
|
Serial.println(state);
|
||||||
while(true);
|
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() {
|
void loop() {
|
|
@ -1,8 +1,9 @@
|
||||||
/*
|
/*
|
||||||
RadioLib Morse Transmit Example
|
RadioLib Morse Transmit SSB Example
|
||||||
|
|
||||||
This example sends Morse code message using
|
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:
|
Other modules that can be used for Morse Code:
|
||||||
- SX127x/RFM9x
|
- SX127x/RFM9x
|
||||||
|
@ -59,7 +60,7 @@ void setup() {
|
||||||
|
|
||||||
// initialize Morse client
|
// initialize Morse client
|
||||||
Serial.print(F("[Morse] Initializing ... "));
|
Serial.print(F("[Morse] Initializing ... "));
|
||||||
// base frequency: 434.0 MHz
|
// carrier wave frequency: 434.0 MHz
|
||||||
// speed: 20 words per minute
|
// speed: 20 words per minute
|
||||||
state = morse.begin(434.0);
|
state = morse.begin(434.0);
|
||||||
if(state == RADIOLIB_ERR_NONE) {
|
if(state == RADIOLIB_ERR_NONE) {
|
Loading…
Add table
Reference in a new issue