| Author | 
		Message | 
	
		 
		thagrandfinale
 
 
 
    
		 | 
		
		
			
				  Posted: 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.
		
	
  
          
							 
	
	
		
	 
	
		|  Description: | 
		
			
		 | 
		  Download | 
	 
	
		|  Filename: | 
		 5.t | 
	 
	
		|  Filesize: | 
		 1.64 KB | 
	 
	
		|  Downloaded: | 
		 438 Time(s) | 
	 
	 
	 
		
 | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
		 
		Sponsor Sponsor 
		 
  
		 | 
		
 | 
	
	 
		  | 
	
				 
		Delos
 
  
 
    
		 | 
		
		
			
				  Posted: Fri Jun 11, 2004 6:39 pm    Post subject: (No 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...
		
 | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		thagrandfinale
 
 
 
    
		 | 
		
		
			
				  Posted: Sat Jun 12, 2004 1:26 pm    Post subject: (No 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?
		
 | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		Paul
 
  
 
    
		 | 
		
		
			
				  Posted: Sat Jun 12, 2004 1:48 pm    Post subject: (No 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.
		
 | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		thagrandfinale
 
 
 
    
		 | 
		
		
			
				  Posted: Sat Jun 12, 2004 3:21 pm    Post subject: (No subject)  | 
	
				
				 | 
			 
			 
				
  | 
			 
			
				Easier said than done   
		
 | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		Paul
 
  
 
    
		 | 
		
		
			
				  Posted: Sat Jun 12, 2004 4:00 pm    Post subject: (No 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
 
 
  | 	  
		
 | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		thagrandfinale
 
 
 
    
		 | 
		
		
			
				  Posted: Sat Jun 12, 2004 7:32 pm    Post subject: (No subject)  | 
	
				
				 | 
			 
			 
				
  | 
			 
			
				| are any programs on this forum have similar to what your talking about? if i look at it i could understand better
		
 | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		Paul
 
  
 
    
		 | 
		
		
			
				  Posted: Sat Jun 12, 2004 8:23 pm    Post subject: (No 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.
		
 | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
		 
		Sponsor Sponsor 
		 
  
		 | 
		
 | 
	
	 
		  | 
	
				 
		thagrandfinale
 
 
 
    
		 | 
		
		
			
				  Posted: Sat Jun 12, 2004 10:40 pm    Post subject: (No subject)  | 
	
				
				 | 
			 
			 
				
  | 
			 
			
				| thanks anyway
		
 | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		TrAnCeIn4LiFe
 
  
 
    
		 | 
		
		
			
				  Posted: Sat Jun 12, 2004 11:11 pm    Post subject: (No 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
		
 | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		thagrandfinale
 
 
 
    
		 | 
		
		
			
				  Posted: Sun Jun 13, 2004 12:34 am    Post subject: (No 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
		
	
  
          
							 
	
	
		
	 
	
		|  Description: | 
		
			
		 | 
		  Download | 
	 
	
		|  Filename: | 
		 1.t | 
	 
	
		|  Filesize: | 
		 1.71 KB | 
	 
	
		|  Downloaded: | 
		 350 Time(s) | 
	 
	 
	 
		
 | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		thagrandfinale
 
 
 
    
		 | 
		
		
			
				  Posted: Sun Jun 13, 2004 12:53 am    Post subject: (No subject)  | 
	
				
				 | 
			 
			 
				
  | 
			 
			
				heres some info bout parallel stuff...
		
	
  
          
							 
	
	
		
	 
	
		|  Description: | 
		
			
		 | 
		  Download | 
	 
	
		|  Filename: | 
		 info.zip | 
	 
	
		|  Filesize: | 
		 24.41 KB | 
	 
	
		|  Downloaded: | 
		 363 Time(s) | 
	 
	 
	 
		
 | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		thagrandfinale
 
 
 
    
		 | 
		
		
			
				  Posted: Sun Jun 13, 2004 1:22 pm    Post subject: (No 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
		
	
  
          
							 
	
	
		
	 
	
		|  Description: | 
		
			
		 | 
		  Download | 
	 
	
		|  Filename: | 
		 elevator gui2.t | 
	 
	
		|  Filesize: | 
		 3.22 KB | 
	 
	
		|  Downloaded: | 
		 374 Time(s) | 
	 
	 
	 
		
 | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		 |