void pausenschleife1(){
for(int i = 0; i<= 1500; i++){
delay(10);
if (digitalRead(pirPin2) == HIGH & i>=550){
i =1500;
}
if (digitalRead(pirPin1) == HIGH){
i =1500;
oben = true;
}
}
}
void pausenschleife2(){
for(int i = 0; i<= 1500; i++){
delay(10);
if (digitalRead(pirPin1) == HIGH & i>=550){
i =1500;
}
if (digitalRead(pirPin2) == HIGH){
i =1500;
unten = true;
}
}
}
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
//////////////////////////////// LOOP //////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
void loop(){
if (digitalRead(pirPin1)== HIGH){
an = true ;
untenAN(); //the leds turned on from bottom to top
if (digitalRead(pirPin1) == HIGH){
rainbow2(mode);
}
pausenschleife1();
if (oben == true){
obenAUS();
}
else{
untenAUS(); //the leds turned off from bottom to top
}
an = false;
oben = false;
}
if (digitalRead(pirPin2) == HIGH){
an = true;
obenAN(); //the leds turned on from top to bottom
if (digitalRead(pirPin2) == HIGH){
rainbow2(mode);
}
pausenschleife2();
if (unten == true){
untenAUS();
}
else{
obenAUS(); //the leds turned off from top to bottom
}
an = false;
unten = false;
}
//Serial.print(fa1);
}
Danke schonmal für die hilfe, ist wie gesagt nen Anfängercode!