Project 2 - Implement the Code for controlling the retraction and extension of Airplane’s landing gear
/*
* Name: Raising_Gear.c
*/
#include "states.h"
void Raising_Gear()
{
current_state = RSING_GR;
printf("\nEnter the limit switch status, pilot lever status:");
fflush(stdout);
scanf("%d%d", &pilot_lever, &limit_switch);
printf("\nwait for 1 sec\n");
if(pilot_lever == Falling && limit_switch == open)
{
current_state = CHK_BFR_LND;
printf("Current state : %s\n", state_machine[current_state].current_state_indication);
printf("light status: %s\n", state_machine[current_state].light_status);
printf("hydraulic control for landing gear status : %s\n",state_machine[current_state].hydraulic_pump_control_status);
}
else if(limit_switch == close && pilot_lever == UP)
{
current_state = GR_UP;
printf("Current state : %s\n", state_machine[current_state].current_state_indication);
printf("light status: %s\n", state_machine[current_state].light_status);
printf("hydraulic control for landing gear status : %s\n",state_machine[current_state].hydraulic_pump_control_status);
}
else
{
Raising_Gear();
}
}