If all the microcontroller is doing is just monitoring what floor its going to, you can just create a loop that reads the inputs, then stores them in array or, using pointers to create a stack and push and pop them as needed. You can find source code for a queue online.
if you need to do other tasks with the microcontroller then you can create a timer interupt, to run the loop.
Then when its time to determine what floor you are on, pop the queue, to determine what floor, and do what you need to with that.