const int fpb = 2;
const int rpb = 3;
const int spb = 4;
const int olr = 5;
const int rc = 6;
const int fc = 7;
const int sc = 8;
const int dc = 9;
int fcstatus = 0;
int rcstatus = 0;
int scstatus = 0;
int dcstatus = 0;
void setup() {
pinMode(fpb, INPUT_PULLUP);
pinMode(rpb, INPUT_PULLUP);
pinMode(spb, INPUT_PULLUP);
pinMode(rc, OUTPUT);
pinMode(fc, OUTPUT);
pinMode(sc, OUTPUT);
pinMode(dc, OUTPUT);
pinMode(olr, INPUT_PULLUP);
}
void loop() {
if (digitalRead(fpb)== LOW && digitalRead(rpb)== HIGH && digitalRead(olr)== LOW && fcstatus == 0 && rcstatus == 0)
{digitalWrite(sc, HIGH);
digitalWrite(fc, HIGH);
delay(2000);
digitalWrite(sc, LOW);
delay(10);
digitalWrite(dc, HIGH);
fcstatus = 1;}
if (digitalRead(fpb)== HIGH && digitalRead(rpb)== LOW && digitalRead(olr)== LOW && fcstatus == 0 && rcstatus == 0)
{digitalWrite(sc, HIGH);
digitalWrite(rc, HIGH);
delay(2000);
digitalWrite(sc, LOW);
delay(10);
digitalWrite(dc, HIGH);
rcstatus = 1;}
if (digitalRead(olr)== HIGH)
{
digitalWrite(dc, LOW);
digitalWrite(sc, LOW);
digitalWrite(fc, LOW);
digitalWrite(rc, LOW);
fcstatus == 0;
rcstatus == 0;
}
}