int R1 = 4;
int R2 = 5; // relay the PWM pin the LED is attached to
int R3 = 12;
int PLAY = 10; // mp3 module
int PAUSE = 9;
int buttonPin = A0;
int buttonState;
// the setup routine runs once when you press reset:
void setup() {
pinMode(buttonPin, INPUT);
digitalWrite(buttonPin, LOW);
pinMode(R1, OUTPUT);
pinMode(R2, OUTPUT);
pinMode(R3, OUTPUT);
pinMode(PLAY, OUTPUT);
pinMode(PAUSE, OUTPUT);
//PULL UP BY MICROCONTROLLER
digitalWrite(PLAY, LOW);
digitalWrite(PAUSE, LOW);
delay(3000);
digitalWrite(PAUSE, HIGH); // turn the LED on (HIGH is the voltage level)
delay(300);
digitalWrite(PAUSE, LOW); // turn the LED on (HIGH is the voltage level)
delay(500);
delay(100);
}
// the loop routine runs over and over again forever:
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
digitalWrite(PLAY, HIGH); // turn the LED on (HIGH is the voltage level)
delay(300); //15
digitalWrite(PLAY, LOW); // turn the LED on (HIGH is the voltage level)
delay(1000);
digitalWrite(R1, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(R3, HIGH);
digitalWrite(R2, HIGH); // turn the LED on (HIGH is the voltage level)
delay(2000);
digitalWrite(R2, LOW); // turn the LED on (HIGH is the voltage level)
digitalWrite(R3, LOW);
delay(3000);
digitalWrite(R3, HIGH); // turn the LED on (HIGH is the voltage level)
delay(5000);
digitalWrite(R1, LOW); // turn the LED on (HIGH is the voltage level)
delay(500);
digitalWrite(PAUSE, HIGH); // turn the LED on (HIGH is the voltage level)
delay(300);
digitalWrite(PAUSE, LOW); // turn the LED on (HIGH is the voltage level)
delay(500);
}
}