Go to Post The competition is about MUCH more than just the robot. If kids are glued to the robot all of the time, then they miss the rest of it... the other fun stuff, what makes FIRST, FIRST. - Kims Robot [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 27-05-2003, 16:25
Ryan Foley Ryan Foley is offline
Registered User
FRC #5687 (The Outliers)
Team Role: Mentor
 
Join Date: Jun 2002
Rookie Year: 2001
Location: ME
Posts: 447
Ryan Foley has a reputation beyond reputeRyan Foley has a reputation beyond reputeRyan Foley has a reputation beyond reputeRyan Foley has a reputation beyond reputeRyan Foley has a reputation beyond reputeRyan Foley has a reputation beyond reputeRyan Foley has a reputation beyond reputeRyan Foley has a reputation beyond reputeRyan Foley has a reputation beyond reputeRyan Foley has a reputation beyond reputeRyan Foley has a reputation beyond repute
how do i control a piston with a joystick

hi there.

I'm having trouble figuring this out.

How can i program a joystick to turn a relay on forward when it goes beyond a certain point (say beyond 147) and backwards when in the opposite direction (beyond for example) and then when the joystick is neutral, the relay is off. We are trying to get a joystick (port 4) to control our piston that moves the arm up and down (relay 6)

Thanks
__________________
Ryan

FRC #5687: The Outliers [2015-?]
FRC #1995: Fatal Error [2007-2009]
FRC #350: Timberlane Robotics [2001-2004]

FRC/FLL volunteer since 2005
  #2   Spotlight this post!  
Unread 27-05-2003, 17:02
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Well, the easiest solution would be:

relay6_fwd=0
relay6_rev=0
if p4_y > 147 then
relay6_fwd=1
else
if p4_y < 107 then relay6_rev=1
endif
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #3   Spotlight this post!  
Unread 27-05-2003, 17:13
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,648
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
try this...

If p4_y > 147 Then
'lift arm up
relay6_fwd = 1
Else
If p4_y < 100 Then
'lower arm
relay6_fwd = 0
Else
'do nothing
Endif
Endif

Note that the above code is from memory and I may have the variable names a bit mixed up.

Also, I don't know how your robot is plumbed. It may be that I don't turn on the relays in the right order or direction or maybe even you use an exotic combination of valves and such that you need to do more that what I suggested to put the arm up or to lower it. But... ... you should be able to figure things out from the code example. Also, you probably need to have something initializing the position when the robot resets or is powered up just to be sure that you are in the state you want to be in when you wake up.

Good luck.

Joe J.

Last edited by Joe Johnson : 27-05-2003 at 17:18.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fried program slots? Jeff Waegelin Programming 18 19-03-2003 18:08
robot goes haywire with the one joystick default code Miles Programming 7 24-01-2003 14:58
joystick problem archiver 2000 12 23-06-2002 23:08
speed control punarhero Technical Discussion 11 24-01-2002 18:03
switching joystick axis????? team222badbrad Technical Discussion 9 16-01-2002 23:07


All times are GMT -5. The time now is 09:11.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi