Hello,
I have scoured the internet looking for a particular loop program. I probably have seen it, but just not in an example I can related to.
I would like to have my program start with a sound, and then loop into another sound from that point on. The initial sound, Darth Vader’s helmet sealing (about 3 to 4 seconds), and then his breathing (4 1/2 seconds intervals) thereafter until I turn it off.
Can anybody please help me with this?
I am using an Arduino Pro Mini 168 & 328 5v and have the following sketch to work with; (I know I can trim it down a bit!)
THANK YOU!
//DARTH VADER HELMET SEAL SOUND AND BREATHING EFFECTS
//1 TIME SEAL AND THEN HIS BREATHING EVERY 4 SECONDS
int outputSeal = 10;
int outputBreathing = 11;
void setup()
{
pinMode(outputSeal, OUTPUT);
pinMode(outputBreathing, OUTPUT);
}
// PROGRAM LOOP
void loop()
{
digitalWrite(outputSeal, HIGH);
digitalWrite(outputBreathing, LOW);
delay(4000);
digitalWrite(outputSeal, LOW);
digitalWrite(outputBreathing, HIGH);
delay(4000);
digitalWrite(outputSeal, LOW);
digitalWrite(outputBreathing, HIGH);
delay(3000);
digitalWrite(outputSeal, LOW);
digitalWrite(outputBreathing, HIGH);
delay(3000);
digitalWrite(outputSeal, LOW);
digitalWrite(outputBreathing, HIGH);
delay(3000);
digitalWrite(outputSeal, LOW);
digitalWrite(outputBreathing, HIGH);
delay(3000);
digitalWrite(outputSeal, LOW);
digitalWrite(outputBreathing, HIGH);
delay(3000);
digitalWrite(outputSeal, LOW);
digitalWrite(outputBreathing, HIGH);
delay(3000);
}