-
-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3aeb43
commit 50b7a1e
Showing
9 changed files
with
868 additions
and
5 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...s-communication/esp-now/pcm/communication-espnow-receive/communication-espnow-receive.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ication/esp-now/pcm/communication-espnow-receive_csv/communication-espnow-receive_csv.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...esp-now/pcm/communication-espnow-receive_measure/communication-espnow-receive_measure.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...xamples-communication/esp-now/pcm/communication-espnow-send/communication-espnow-send.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...les/examples-communication/lora/communication-lora-receive/communication-lora-receive.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* @file example-lora-receive_measure.ino | ||
* @author Phil Schatzmann | ||
* @brief Receiving audio via LoRa with max speed to measure thruput. | ||
* @version 0.1 | ||
* @date 2023-11-09 | ||
* | ||
* @copyright Copyright (c) 2022 | ||
* | ||
*/ | ||
|
||
#include "AudioTools.h" | ||
#include "AudioTools/Communication/LoRaStream.h" | ||
|
||
LoRaStream lora; | ||
MeasuringStream out; // or CSVStream<uint8_t> | ||
StreamCopy copier(out, lora); | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Info); | ||
while(!Serial); | ||
|
||
auto cfg = lora.defaultConfig(); | ||
lora.begin(cfg); | ||
|
||
// start output | ||
Serial.println("starting Out..."); | ||
out.begin(); | ||
|
||
Serial.println("Receiver started..."); | ||
} | ||
|
||
void loop() { | ||
copier.copy(); | ||
} |
45 changes: 45 additions & 0 deletions
45
examples/examples-communication/lora/communication-lora-send/communication-lora-send.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* @file example-lora-send.ino | ||
* @author Phil Schatzmann | ||
* @brief Sending data over LoRa. We use a Heltec WiFi LoRa V3 board for testing. | ||
* V3 boards use the SX1262. | ||
* @version 0.1 | ||
* @date 2023-11-09 | ||
* | ||
* @copyright Copyright (c) 2022 | ||
*/ | ||
|
||
#include "AudioTools.h" | ||
#include "AudioTools/Communication/LoRaStream.h" | ||
|
||
AudioInfo info(8000, 1, 16); | ||
SineWaveGenerator<int16_t> sineWave( 32000); // subclass of SoundGenerator with max amplitude of 32000 | ||
GeneratedSoundStream<int16_t> sound( sineWave); // Stream generated from sine wave | ||
LoRaStream lora; | ||
StreamCopy copier(lora, sound); // copies sound into i2s | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Info); | ||
while(!Serial); | ||
Serial.println("starting..."); | ||
|
||
// Setup LoRa | ||
Serial.printf("SCK: %d, MISO: %d, MOSI: %d, SS=%d", SCK,MISO,MOSI,SS); | ||
SPI.begin(SCK, MISO, MOSI, SS); | ||
auto cfg = lora.defaultConfig(); | ||
cfg.copyFrom(info); | ||
if (!lora.begin(cfg)){ | ||
Serial.println("LoRa failed"); | ||
stop(); | ||
} | ||
|
||
// Setup sine wave | ||
sineWave.begin(info, N_B4); | ||
|
||
Serial.println("Sender started..."); | ||
} | ||
|
||
void loop() { | ||
copier.copy(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.