-
-
Notifications
You must be signed in to change notification settings - Fork 239
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
9213f4c
commit 81cbbb6
Showing
5 changed files
with
217 additions
and
65 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
examples/examples-custom-boards/lyrat-mini/buttons/buttons.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,51 @@ | ||
|
||
#include "AudioTools.h" | ||
#include "AudioTools/AudioLibs/AudioBoardStream.h" | ||
|
||
AudioBoardStream lyrat(LyratMini); | ||
|
||
void rec(bool, int, void*) { | ||
Serial.println("rec"); | ||
} | ||
|
||
void mode(bool, int, void*) { | ||
Serial.println("mode"); | ||
} | ||
|
||
void play(bool, int, void*) { | ||
Serial.println("play"); | ||
} | ||
|
||
void set(bool, int, void*) { | ||
Serial.println("set"); | ||
} | ||
|
||
void volUp(bool, int, void*) { | ||
Serial.println("vol+"); | ||
} | ||
|
||
void volDown(bool, int, void*) { | ||
Serial.println("vol-"); | ||
} | ||
|
||
|
||
// Arduino Setup | ||
void setup(void) { | ||
Serial.begin(115200); | ||
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Warning); | ||
|
||
// start board | ||
lyrat.begin(lyrat.defaultConfig(TX_MODE)); | ||
|
||
lyrat.addAction(KEY_REC, rec); | ||
lyrat.addAction(KEY_MODE, mode); | ||
lyrat.addAction(KEY_PLAY, play); | ||
lyrat.addAction(KEY_SET, set); | ||
lyrat.addAction(KEY_VOLUME_UP, volUp); | ||
lyrat.addAction(KEY_VOLUME_DOWN, volDown); | ||
|
||
} | ||
|
||
void loop() { | ||
lyrat.processActions(); | ||
} |
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,29 @@ | ||
|
||
|
||
#include "AudioTools.h" | ||
#include "AudioTools/AudioLibs/AudioBoardStream.h" | ||
|
||
AudioInfo info(44100, 1, 16); | ||
AudioBoardStream i2s(LyratMini); // Access I2S as stream | ||
CsvOutput<int16_t> csvStream(Serial); | ||
StreamCopy copier(csvStream, i2s); // copy i2s to csvStream | ||
|
||
// Arduino Setup | ||
void setup(void) { | ||
Serial.begin(115200); | ||
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Warning); | ||
|
||
auto cfg = i2s.defaultConfig(RX_MODE); | ||
cfg.copyFrom(info); | ||
//cfg.input_device = ADC_INPUT_LINE2; | ||
i2s.begin(cfg); | ||
|
||
// make sure that we have the correct number of channels set up | ||
csvStream.begin(info); | ||
|
||
} | ||
|
||
// Arduino loop - copy data | ||
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
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.