#include <Arduino.h> 
#include "DFRobotDFPlayerMini.h"


     
	  char  First_Start   = 1;                                              
//  int   playPausePin  = 4; 
//  int   nextPin       = 0; 
//  int   volumeDownPin = 2; 
//  int   volumeUpPin   = 15; 
    
    int   volume        = 1;
    int   musicMode     = 1; //1=night,2=day
    int   songNumber    = 1;
    int   songsCount    = 1;
    bool  isPlaying     = true;
    bool  isNextPressed = false;
    unsigned long nextPressedTime;
    
    void printDetail(uint8_t type, int value);
    void checkButtons();


  void LumiZic_Setup ()
{ 
  /*
      pinMode(playPausePin, INPUT);                                   
      pinMode(nextPin, INPUT);
      pinMode(volumeDownPin, INPUT);
      pinMode(volumeUpPin, INPUT);
      digitalWrite(playPausePin, LOW);
      digitalWrite(nextPin, LOW);
      digitalWrite(volumeDownPin, LOW);
      digitalWrite(volumeUpPin, LOW);
  */
}



  void checkButton()
{
 /* 
  int volumeDown = digitalRead(volumeDownPin);
  int volumeUp = digitalRead(volumeUpPin);
  int playPause = digitalRead(playPausePin);
  int next = digitalRead(nextPin);

  if(volumeDown == 1){
    myDFPlayer.volumeDown(); //Dirty [TO-DO]
    myDFPlayer.volumeDown();
    myDFPlayer.volumeDown();
    delay(500);
  }
  if(volumeUp == 1){
    myDFPlayer.volumeUp(); //Dirty [TO-DO]
    myDFPlayer.volumeUp();
    myDFPlayer.volumeUp();
    delay(500);
  }
  if(next){
    if(!isNextPressed){
      nextPressedTime = millis();
    }
    isNextPressed = true;
  } else {
    if(isNextPressed){
      isNextPressed = false;
      if(millis() - nextPressedTime > 1000){
        musicMode = musicMode == 1 ? 2 : 1;
        //Following good be refactored
        if(musicMode == 1){
          myDFPlayer.playFolder(1, 1);
        } else {
          myDFPlayer.playFolder(2, songNumber);
        }
      } else if(musicMode != 1) {
        nextSong();
      }
      delay(500);
    } 
  }
  if(playPause){
    isPlaying = !isPlaying;
    if(isPlaying == true){
      myDFPlayer.start();
    } else {
      myDFPlayer.pause();
    }
    delay(500);
  }
  */
}
