mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Update MiniDSP example for input source retrieval.
This commit is contained in:
parent
3a36dfeccd
commit
69c6db777f
1 changed files with 15 additions and 0 deletions
|
@ -25,6 +25,20 @@ void OnMutedChange(bool isMuted) {
|
||||||
Serial.println("Muted status: " + String(isMuted ? "muted" : "unmuted"));
|
Serial.println("Muted status: " + String(isMuted ? "muted" : "unmuted"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnInputSourceChange(MiniDSP::InputSource inputSource) {
|
||||||
|
String inputSourceStr;
|
||||||
|
|
||||||
|
if(inputSource == MiniDSP::InputSource::ANALOG) {
|
||||||
|
inputSourceStr = "Analog";
|
||||||
|
} else if(inputSource == MiniDSP::InputSource::TOSLINK) {
|
||||||
|
inputSourceStr = "Toslink";
|
||||||
|
} else if(inputSource == MiniDSP::InputSource::USB) {
|
||||||
|
inputSourceStr = "USB";
|
||||||
|
}
|
||||||
|
|
||||||
|
Serial.println("Input source: " + inputSourceStr);
|
||||||
|
}
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
#if !defined(__MIPSEL__)
|
#if !defined(__MIPSEL__)
|
||||||
|
@ -40,6 +54,7 @@ void setup() {
|
||||||
MiniDSP.attachOnInit(&OnMiniDSPConnected);
|
MiniDSP.attachOnInit(&OnMiniDSPConnected);
|
||||||
MiniDSP.attachOnVolumeChange(&OnVolumeChange);
|
MiniDSP.attachOnVolumeChange(&OnVolumeChange);
|
||||||
MiniDSP.attachOnMutedChange(&OnMutedChange);
|
MiniDSP.attachOnMutedChange(&OnMutedChange);
|
||||||
|
MiniDSP.attachOnInputSourceChange(&OnInputSourceChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|
Loading…
Reference in a new issue