Changing the volume pin

SteveSFX

Well-known member
Hi all

Is there a way to change the volume pin on the Teensy 4.1 audio board from Pin 15 to another analogue input using software?
Or, do I need to change that pin (if possible) in the library

Pin 15 as the volume uses up Serial3 and I need it.

Thanks
 
Audio Adapter rev D/D2? No, its hard wired on the PCB. If you don't piggyback the adapter you could wire it however you like though.
 
I am not piggybacking the PCB for that reason. It's where I change the pin allocation in the Teensy audio software.
I'll poke around some code later
 
I am not piggybacking the PCB for that reason. It's where I change the pin allocation in the Teensy audio software.
I'll poke around some code later
@SteveSFX:

There is nothing to change in the audio library. In order to do what you are asking, everything can actually be simply controlled from your user sketch. See the Teensy Example (which can be accessed from the Arduino IDE) titled "Part_1_05_Do_More_While_Playing". This simple example sketch shows how to make use of reading the A2 analog input pin (any unused analog input pin could be used in its place...just wire your volume pot with one end tied to GND, the other end tied to 3.3VDC for T4.x (not 5VDC tolerant, so be extra careful with this !!), and the wiper tied to the selected analog input pin) & making use of the resulting value to control the SGTL5000 volume (take a look specifically at the code at the end of the loop() function).

Hope that helps . . .

Mark J Culross
KD5RXT
 
Yea... ha, just realised that and just looked at the code "Part_1_05_Do_More_While_Playing".

I thought maybe pin 15 was tied to the library but it appears not

Thanks
 
Back
Top