This machine does not monitor a real elevator. It simulates real-ish requests for service from an elevator in a building that no longer exists.
On startup, it does a "lamp test" (scrolling all of the LEDs, then blinking them).
After that, an Interrupt Service Routine (the TIMER1 compare ISR) running at 10 Hz uses a probability table to determine how many people, if any, have pressed the Up or Down button on a floor. Another table determines what floor each passenger presses when he gets inside the car, based on what floor he got into the car from and which direction button he pressed. For example, a person who pressed the Down button on the 7th floor has no probability of getting inside the car and pressing the 10th floor. He's most likely going to the 2nd or 1st floor, because the lobby was on 2 and the cafeteria was on 1.
The code simulates that boarding and unboarding passengers take a random amount of time to get into or out of the elevator car, respectively.
The loop() routine runs with interrupts off so the ISR can't mess things up while loop() is handling moving the car and boarding and unboarding passengers. The Arduino queues missed interrupts, so between passes through loop(), I turn interrupts back on momentarily so the ISR can run. And interrupts are on during delays waiting for things.
In order to make the simulation watchable as a conversation piece, I made the car move a little faster and requests come a little more often than they really did. And in order to facilitate testing, if you flip the Demo DIP switch, everything happens even faster --- 4x faster.
Future enhancements: The real elevator occasionally stopped working. The real elevator also dropped people a couple of floors occasionally. The real elevator would get stuck between two floors often [it seemed to have a special fondness for kidnapping the cooks]. And the real elevator's lamps burned out and took a while to get fixed.
Funny you should mention that! Here is my current "things to emulate in the future" file, based on the actual behavior of my dorm's Satan-possessed elevators:
Occasionally, the lamp on a floor would burn out; it would often be a long time before it was fixed.
Occasionally, an elevator would stop working; it might also be a long time before it would be repaired.
Occasionally, the elevator car would stop and get stuck between floors.
Occasionally (although mercifully not often), the elevator would just decide that your underwear were too clean, so it would let go of the car and let you fall a couple of floors under gravity. This was not too bad if you started on the 3rd floor, but if you started on the 9th or 10th floor, it could get pretty exciting.