Two Audio Volume settings

hbtousa

Active member
I have seen on so many sketches the use of sgtl5000_1.volume(n.n) and the use of knob = analogRead(Analog) to manage the volume. Mic.JPG.
My questions are so many. When I use one or the other.? Do I need both.? What controls what? My final goal is to use a touchscreen icon to increase/decrease the vol. but, I am not sure if I still need the Analog pin set up for this purpose. I am running out of pins, or better, I am trying to maximize the use of pins. I have a 3.6, 4.1, and the two audio shields REV C/D. Thanks very much
 
My final goal is to use a touchscreen icon to increase/decrease the vol. but, I am not sure if I still need the Analog pin set up for this purpose.

@hbtousa: Unless you are reading a physical potentiometer, you should not need to consume an analog input pin for volume control. You just need your touchscreen volume control (implemented as a slider or as UP/DOWN buttons) to return a value between 0.0 & 1.0 (scaling by using the map() function if/as necessary). You simply make the call to the sgtl5000_1.volume(n.n) function, & send that value to the Audio Board to control the volume electronically.

Feel free to ask more questions as necessary.

Mark J Culross
KD5RXT
 
Back
Top