Music Module

This software module

  1) Controls the MP3 player to play music

 

NOTE: only 2 buttons are used: PLAY and NEXT. PLAY is also PAUSE

 

Public Functions:

initMusic

  Press the play button

  Wait for 1.5 seconds

  Press the play button

 

  This sets up the MP3 such that the next time Next is pressed, music will start automatically

 

playMusic

  If MP3 player is currently NOT playing

    Press the next button 

 

stopMusic

  If MP3 is currently playing

    Press play button to pause it

 

restartMusic

  Press next button

 

Module Functions:

pressPlay

   Set output to play button transistor to HI

   Wait a calibrated amount of time

   Set output to play button transistor to LO

 

pressNext

   Set output to next button transistor to HI

   Wait a calibrated amount of time

   Set output to next button transistor to LO  

 

wait(wait_time)

  Wait until the current time minus the start time is greater than the wait_time