Computer Science Canada

Elevator program

Author:  thagrandfinale [ Fri Jun 11, 2004 2:22 pm ]
Post subject:  Elevator program

I made an elevator and I control a stepper motor. What I use is the parallel cable to connect to an input device and I have a keypad that controls up and down. But what I want to do is control which floors to go to and also continuous movement because what i have to do is hold a number to keep it moving and i dont want to have to do that. if anyone can help me with this program it would be appreciated.

What i added was teh simple program i made just for up and down movements.

Author:  Delos [ Fri Jun 11, 2004 6:39 pm ]
Post subject: 

Sorry dude...most ppls here don't have/use parallelport too much...
I looked at the code, couldn't quite make heads or tails of it...

You just may be on your own...

Author:  thagrandfinale [ Sat Jun 12, 2004 1:26 pm ]
Post subject: 

well say you just made a visual of the program elevator then. how would you control what floor to go to, say u were at the first, how would u go to the second and not keep gonig to the third?

Author:  Paul [ Sat Jun 12, 2004 1:48 pm ]
Post subject: 

I'd have preset coordinates for each floor, like in an array, then when the floor is chosen, I'd runa for loop to animate the elevator moving to that floor.

Author:  thagrandfinale [ Sat Jun 12, 2004 3:21 pm ]
Post subject: 

Easier said than done Confused

Author:  Paul [ Sat Jun 12, 2004 4:00 pm ]
Post subject: 

lol, what are u talking about, I don't know anything about the real elevator program with the parallel ports, but I do know the animation isn't difficult.
its like u have 2 variables, one for the current floor and one for the floor ur going, have the coordinates of each floor in an array, then do something like
code:

if going up then
for a: current..destination
drawelevator (elevator, x, a, 2)
delay (5)
View.Update
cls
end for
elsif going down then
for decreasing a: current..destination

drawelevator (elevator, x, a, 2)
delay (5)
View.Update
cls
end for
end if


Author:  thagrandfinale [ Sat Jun 12, 2004 7:32 pm ]
Post subject: 

are any programs on this forum have similar to what your talking about? if i look at it i could understand better

Author:  Paul [ Sat Jun 12, 2004 8:23 pm ]
Post subject: 

I don't think so, if I was inclined to touch turing this month I'd make one right now, but Im not, so u can always wait until someone finds this thread and decides to make one.

Author:  thagrandfinale [ Sat Jun 12, 2004 10:40 pm ]
Post subject: 

thanks anyway

Author:  TrAnCeIn4LiFe [ Sat Jun 12, 2004 11:11 pm ]
Post subject: 

here is a code for elevator that works but with out binary to decimal decoder ....

code:

parallelput (1)
delay (2000)
% These two lines of code lift the elevator's platform for 2 seconds.

put "Welcome to floor one!"

parallelput (0)
delay (2000)
% This command leaves the elevator at floor one for 2 seconds.

parallelput (1)
delay (2000)
% This command raises the elevator to floor 2.

put "Welcome to floor two!"

parallelput (0)
delay (2000)
% This command leaves the elevator at floor two for 2 seconds.

parallelput (2)
delay (2000)
% Brings the elavator down to level 1.

put "Welcome to floor one!"

parallelput (0)
delay (2000)
% This command leaves the elevator at floor one for 2 seconds.

parallelput (2)
delay (2000)
% This command returns the platform to ground level.

put "Welcome to the ground level!"
parallelput (0)


if u want also binary to decimal decoder u have to change paralleputs a bit, put 8 to display floor 2 and also paralleput2 in same parallel put
ex paralleput ( 2 + 8)
and for it to display floor 1 i belvie it goes something like
parallelput ( 2+4)
ill check 2morow

Author:  thagrandfinale [ Sun Jun 13, 2004 12:34 am ]
Post subject: 

Well to help other people out... i put keypad wires into my input device and the connectors act like binary... 1 2 4 8 16 32 64 128 and ground.... so my x values are teh base value of the computer plus the connector... so for example. x = 132 i got that from say the base value was 128 for the computer, then 4 would be what the keypad was connected to, to operate. i guess i should update my comments

Author:  thagrandfinale [ Sun Jun 13, 2004 12:53 am ]
Post subject: 

heres some info bout parallel stuff...

Author:  thagrandfinale [ Sun Jun 13, 2004 1:22 pm ]
Post subject: 

Can anyone edit this program so it can go to each floor? i already have it all started... well i jsut cant get floor 2 to work


: