8051 connections for an elevator

Status
Not open for further replies.

kautilya

New Member
hi there,

this is regarding my earlier post of an elevator programmed with 8051.

i am using some spst switches for giving user inputs to the microcontroller for going to a partcular floor as well as responding to inputs outside the lift. i want to monitor the status of the switches by maintaining a queue of order in which the switches are pressed so tht lift stops on floor in the order user requested.

can anyone suggest how do i go abt it?

regards
kautilya
 
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.
 

Can you post the circuit diagram here ?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…