Arduino Forum

Using Arduino => Audio => Topic started by: Falsity200 on May 05, 2019, 07:25 am

Title: How can I control mp3 shield??
Post by: Falsity200 on May 05, 2019, 07:25 am
I want to control the volume with a switch.

If the button is off, the volume is adjusted to a certain value,
Pressing and holding the button adjusts to the original volume.

However, I do not know how to use it in this code.

This code could not be controlled by my code or this.

The code in the file is the demo code for the mp3 shield.


Maybe mp3_vol.byte[1] is right, but I don't know how to use it.


Code: [Select]
  if (buttonState == HIGH)
  {
    // volume down
    if (mp3_vol.byte[1] <= 254)
    { // range check
      mp3_vol.byte[1] = 10;

    }
    else
    {
      mp3_vol.byte[1] = 254;
     
    }
  }

  else
  {
    mp3_vol.byte[1] = 254;

  }