Question: enum { Idle , BlueLED, . . . . . . . . . . . , GreenLED, RedLED, . . . . . .

enum {Idle, BlueLED, ..........., GreenLED, RedLED, ............};
int current = Idle;
//OUTPUTS
int Blue =5;
int Yellow =6;
int Green =7;
int Red =8;
int Motor =3;
//INPUTS
int PB_1=9;
int PB_2=10;
int PB_3=11;
void setup()
{
Serial.begin(9600);
pinMode(Motor,........);
pinMode(Blue, OUTPUT);
pinMode(........, OUTPUT);
pinMode(Green, OUTPUT);
pinMode(Red, OUTPUT);
pinMode(PB_1,.............);
pinMode(...., INPUT_PULLUP);
pinMode(...., INPUT_PULLUP);
}
void output(.........., int yValue, int gValue, .........,..... mValue)
{
..........................;
digitalWrite(Yellow, yValue);
..........................;
..........................;
digitalWrite(Motor, mValue);
}
void loop()
{
switch (current)
{
case Idle:
Serial.println("We are in Idle state");
output(0,0,0,0,0);
if (digitalRead(PB_1)==0)
current = BlueLED;
delay(80);
if (digitalRead(PB_3)==0)
current = RedLED;
break;
case BlueLED:
Serial.println("We are in BlueLED state");
....................;
if (digitalRead(PB_2)==....)
..........= YellowLED;
delay(80);
if (........................)
current = RedLED;
break;
case YellowLED:
Serial.println("We are in YellowLED state");
output(............);
if (digitalRead(......)==0)
current =.............;
delay(80);
if (digitalRead(PB_3)==0)
current =............;
break;
case GreenLED:
Serial.println("We are in GreenLED state");
....................;
if (....................)
current = MotorON;
break;
case MotorON:
Serial.println("We are in MotorON state");
output(1,1,1,0,1);
...............;
current =........;
break;
case RedLED:
.....................;
.....................;
.....................;
.....................;
break;
}
}
complete the missing part

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!