Download RDCS423 lab sheet

Transcript
A/Prof. Gary Bundell
16-Mar-04
none
clearLiftAnswer (floorDir : FloorDir) :
Purpose:
Method to clear the lift call answer LEDs
Inputs:
FloorDir.floor FloorDir.direction
0
1 -> clear floor 0 Up answer LED
1
0 -> clear floor 1 Down answer LED
1
1 -> clear floor 1 Up answer LED
2
0 -> clear floor 2 Down answer LED
2
1 -> clear floor 2 Up answer LED
3
0 -> clear floor 3 Down answer LED
Outputs:
none
setLiftRequestAck (floorDir : FloorDir) :
Purpose:
Method to set the lift call request acknowledgement LEDs
Inputs:
FloorDir.floor FloorDir.direction
0
1 -> set floor 0 Up ack LED
1
0 -> set floor 1 Down ack LED
1
1 -> set floor 1 Up ack LED
2
0 -> set floor 2 Down ack LED
2
1 -> set floor 2 Up ack LED
3
0 -> set floor 3 Down ack LED
Outputs:
none
clearLiftRequestAck (floorDir : FloorDir) :
Purpose:
Method to clear the lift call request acknowledgement LEDs
Inputs:
FloorDir.floor FloorDir.direction
0
1 -> clear floor 0 Up ack LED
1
0 -> clear floor 1 Down ack LED
1
1 -> clear floor 1 Up ack LED
2
0 -> clear floor 2 Down ack LED
2
1 -> clear floor 2 Up ack LED
3
0 -> clear floor 3 Down ack LED
Outputs:
none
A/Prof. Gary Bundell
16-Mar-04
setLiftStop () :
Purpose:
Method to set the lift to stop
Inputs:
none
Outputs:
none
setLiftSpeed (speed : int) :
Purpose:
Method to set the lift speed
Inputs:
int speed
= 0 -> low speed
= 1 -> high speed
Outputs:
none
FloorSense
This class just contains two integer attributes for floor and intermediate floor sensors values
Public Attributes:
floor : int
inter : int
FloorDir
This class just contains two integer attributes for floor and direction
Public Attributes:
floor : int
direction : int
LiftMotor
This class represents the Lift Motor part of the API. and allows the lift motor direction and speed to be
controlled.
Public Operations:
setLiftRun (direction : int) :
Purpose:
Method to set the lift to run in a particular direction
Inputs:
int direction
= 0 -> down
= 1 -> up
Outputs:
none
25
26