Simulation of elevator oscillating between 2 floors. More...
Functions | |
def | elevator_simulation.elevator_cmd (cmd) |
Commands the motor to move up or down. More... | |
def | elevator_simulation.first_sensor () |
Activates when elevator reaches first floor. | |
def | elevator_simulation.second_sensor () |
Activates when elevator reaches second floor. | |
def | elevator_simulation.button_1 () |
Gets pressed when one wants to go to 1st floor. | |
def | elevator_simulation.button_2 () |
Gets pressed when one wants to go to 2nd floor. | |
Variables | |
int | elevator_simulation.state = 0 |
Records the finite state the simulation is in. | |
Simulation of elevator oscillating between 2 floors.
A button for floor 1 and floor 2 are pressed to make the elevator go up and down. The elevator stops once it activates the sensors at each floor. The events are randomly generated. Source code here: https://bitbucket.org/ColeSheedy/me-305-work-repository/src/master/HwWork/HW2/elevator_simulation.py
def elevator_simulation.elevator_cmd | ( | cmd | ) |
Commands the motor to move up or down.
cmd | The command to give the motor. Options are 'up', 'down', or 'stop'. |