Change Input #185
-
is it posible to change the input after setup in Runtime so that my following code will run void testAuxIn(bool Detect) { with regarts bernhard |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 11 replies
-
I am not really sure what you are trying to do: But if you want to change the input_device you have to call kit.end() and kit:begin(kitcfg) with the changed configuration. |
Beta Was this translation helpful? Give feedback.
-
To my knowledge there is no functionality to detect if LineIn is plugged in. The only strategy I could think of is actually switch alternatively between the 2 in order to detect if you have a signal. You could use the VolumePrint class to determine the volume. This will however only work if your board is not messed up and can separate between line 1 (microphone) and line 2 (aux in). |
Beta Was this translation helpful? Give feedback.
-
Oh, I didn't know that this is working. Did you do a pinMode(AuxDetectPin, INPUT_PULLUP); ? |
Beta Was this translation helpful? Give feedback.
-
Well, you could directly use the driver functions. I assume that you have a es8388 based board: |
Beta Was this translation helpful? Give feedback.
-
I2C is used to communicate with the Codec. I am not sure what you need to do to avoid any conflicts. If you selected the Wire library to be used in the config here is the implementation: https://github.com/pschatzmann/arduino-audiokit/blob/main/src/audio_hal/i2c_wire.cpp I just double checked: you would need to use Wire1 for your oled |
Beta Was this translation helpful? Give feedback.
-
Oh, this has nothing to do with hardware. Wire and Wire1 are defined in the ESP32 Wire library |
Beta Was this translation helpful? Give feedback.
I am not really sure what you are trying to do: But if you want to change the input_device you have to call kit.end() and kit:begin(kitcfg) with the changed configuration.