Challenge

Project 2 - Implement the Code for controlling the retraction and extension of Airplane’s landing gear

1, In this project we have 6 states they are Gear Down,Checking before Take off Delay 3s,Raising Gear,Gear UP,Checking before Landing,Lowering Gear, this 6 states are intialized with enum and funtions,And those states are controlled by the pilot lever , squat switch and limit switch. in the piolt lever we have 4 members they are :

typedef enum Pilot_Lever 
{
Raising, 
Falling,
UP,
DOWN
}Pilot_Lever_Status;

And switch:typedef enum Switch 
{
Open, 
Close
}Switch_Status;

And we declare the struct having the current status,..etc and created 7 different funtions they are state funtions those functions adderss is placed in the struct table array.

In the main funtion first we call the intial function and in the funtion we have current state. and in the main function in the while loop we declared the state table [] with current state. where current status is enum type those valus are like 0,1,2,3,4,5 with those value we call the state function.in the state function if the following conditions trun then it goes to the next state.  

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.