ME 305 Website by Cole Sheedy
elevator_simulation.py File Reference

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.
 

Detailed Description

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

Elevator State Machine Diagram
Author
Cole Sheedy
Date
1/27/2020

Function Documentation

◆ elevator_cmd()

def elevator_simulation.elevator_cmd (   cmd)

Commands the motor to move up or down.

Parameters
cmdThe command to give the motor. Options are 'up', 'down', or 'stop'.
Returns
A statement of what the elevator was commanded to do.