With this code, the desired outcome is to use a ATTiny85 chip with a DFRobotPlayerMini MP3 in order to play 8 songs one way and 8 songs an other way with a toggle two way switch on an RC controller.
The current code i have come up with for the project, only works playing the next song on the high value but when trying to implement the feature to play the previous song on the low value, it constantly loops all the songs on the mp3 player continuously . I also want to implement a feature where if i where to hold the switch one way the volume goes up and the other way it goes down.
I’ve tried different librarys for the DFRobotMiniPlayer to see if would I have any success but I am constantly facing the same issue.
I’ve attached the code for this project in hopes of someone being able to help. I’ve also attached the link to the DFPlayer_Mini_Mp3 library that is being used in this project. (GitHub - DFRobot/DFPlayer-Mini-mp3)
SoftwareSerial mySerial(4, 3); // RX, TX
mp3_set_serial (mySerial); //set softwareSerial for DFPlayer-mini mp3 module
delay(2); //wait 1ms for mp3 module to set volume
data1=pulseIn(2,HIGH);if (data1>1750)mp3_next ();else mp3_stop (); // this does work
data1=pulseIn(2,LOW);if (data1>1250)mp3_prev ();else mp3_stop (); // this does not work, this is the issue so far.