Question: Lift Display Controller Overview Elevator Lift Services is currently developing a new lift system for an 11-floor building. The building has one lift. To achieve
Lift Display Controller Overview Elevator Lift Services is currently developing a new lift system for an 11-floor building. The building has one lift. To achieve maximum efficiency, the lift system is a bit unconventional. Instead of the usual up and down call buttons, each floor has 10 call buttons, numbered from 0 (for ground) to 10 but excluding the floor number where the buttons are residing. Since the destination is determined when calling, the lift does not need buttons to indicate the destination floors. Instead, the lift has 11 multi-colored LEDs, which are viewable from both inside and outside the lift, to indicate the floors it will stop. Each LED represents a single floor. Thus passengers are able to decide and board the lift that can get them to their destination floor. A blue LED indicates that the lift is stopping on the floor to drop off passengers, and possibly to pick up passengers. A red LED indicates the lift may stop on the floor to pick up passengers, depending on the schedulers last minute decision. An unlit LED indicates that the lift will not stop on the floor.
Technique A single display controller controls the color of the LEDs on the lift. Your job is to write the controller in C. You must implement 3 functions/modules to handle call requests and lift stops: DisplayInit: Called to initialize the controller. The input parameters are floor and color. LiftCalled: Called when a call button is pressed. The input parameters are fromFloor and toFloor. LiftStopped: Called when the lift stops at floor and will be moving in the specified direction (-1 = down, 0 = drop off only, 1 = up). The input parameters are stopfloor and direction. Upon initialization, the display controller must turn off all LEDs. When it becomes known that a lift no longer needs to stop on a particular floor, the display controller must switch off the LED for the floor.
Goals Write a C program that will be able to fulfill the given specifications. To help to write this program, Finite State Machine (FSM) can be used to help visualize the project. Programming should be in c format.Cannot use c ++ format or any other languages format. Only c are accepted.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
