Push button 1,2,3 correspond to their floors respectively. The fourth button will be an emergency stop button. My question is, how would I let it know what floor it's currently on and to adjust for the amount to spin the stepper motor so that it can arrive at the appropriate floor? Ex: if it's already on the 3rd floor, and now I want to go to the 2nd floor, how do I let it know that?
yes.
You either need sensors to feedback the current location or you have to keep a record of what floor it's on and know how many pulses it takes to get from A to B.
adjust for the amount to spin the stepper motor so that it can arrive at the appropriate floor?
Either calculate based on the mechanical aspects of the design or just do it imperially, ie. run the motor from A until it gets to B and record the number of steps.
Once you have that info, if you are on floor 2 and you give say 200 steps you know you are on floor 3. etc etc.
It all depends on the mechanical design and how repeatable it is. Feedback is better.
Rob
Unless you reset the elevator to a known position every time before you power it up, you will need at least one sensor. If you do the manual reset, you can simply keep track of the steps you have asked the motor to perform and assume it did them, giving you a known position as described above. Slightly better is to have a sensor at the elevator's home floor - top or bottom for simplicity. Then, on power up, move the elevator towards home until the sensor tells you it has reached there. Then go into operational mode and count steps as before.