Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Two Audio Volume settings

  1. #1

    Two Audio Volume settings

    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. Click image for larger version. 

Name:	Mic.JPG 
Views:	2 
Size:	77.4 KB 
ID:	28656.
    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

  2. #2
    Senior Member
    Join Date
    Apr 2020
    Location
    DFW area in Texas
    Posts
    386
    Quote Originally Posted by hbtousa View Post
    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

  3. #3
    Thanks so much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •