Go Down

Topic: How can I control mp3 shield?? (Read 89 times) previous topic - next topic

Falsity200

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;

  }

Go Up