Go to Post Safe zones are for the weak. - ChristopherSD [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 16-02-2003, 15:55
RAWdealer59 RAWdealer59 is offline
Registered User
#0059 (RamTech)
 
Join Date: Feb 2003
Location: Miami, FL
Posts: 8
RAWdealer59 is an unknown quantity at this point
Toggle between in and out (Pneumatics)

How can we program the pneumatics to toggle between in and out? Right now we can only leave the piston out by holding the button down. How can we set it up to toggle?

Thanks
  #2   Spotlight this post!  
Unread 16-02-2003, 16:38
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,567
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
are you using a single or double solenoid. What type of switch are you using (spst, dpdt, momentary, locking, etc). That's the bare minimum information, because each combination would have a different line (or lines) of code to work.
  #3   Spotlight this post!  
Unread 16-02-2003, 17:03
tonyargote's Avatar
tonyargote tonyargote is offline
Registered User
#0059 (RamTech 59)
 
Join Date: Jan 2003
Location: Florida
Posts: 70
tonyargote is an unknown quantity at this point
Send a message via AIM to tonyargote Send a message via Yahoo to tonyargote
i believe we are using a double solenoid
__________________
TArgote
Driver, Programmer, Webmaster
www.RamTech59.com

UCF: Ranked 13th (2nd Highest QP's in the Nation! (349))
Championship: Ranked 12 out of 73 teams in Archimedes Division, Quater finalist allied with 1108 (GO 1108!) & 868 ( GO 868!)
  #4   Spotlight this post!  
Unread 16-02-2003, 22:30
Coach C's Avatar
Coach C Coach C is offline
Registered User
#0341 (Miss Daisy)
 
Join Date: Nov 2002
Location: Wissahickon High School
Posts: 13
Coach C is an unknown quantity at this point
You probably have something like this:

relayX_fwd = pX_sw_trig

You need something like this:

if (pX_sw_trig) then relayX_fwd = 1
if (pX_sw_top) then relayX_fwd = 0

If using two buttons is out of the question, you'll have to get a bit more creative:

if ((pX_sw_trig ~= LastState) & (pX_sw_trig = 1)) then
relayX_fwd = OpenClose
OpenClose = OpenClose - 1
endif
LastState = pX_sw_trig
  #5   Spotlight this post!  
Unread 16-02-2003, 22:59
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
Quote:
Originally posted by Coach C

if ((pX_sw_trig ~= LastState) & (pX_sw_trig = 1)) then
relayX_fwd = OpenClose
OpenClose = OpenClose - 1
endif
LastState = pX_sw_trig
The PBASIC operator for not equal is <>. Also, use the keyword AND instead of &. Finally, can get rid of the variable OpenClose and just use relayX_fwd=1-relayX_fwd if you are running low on variable space. Either way, make sure to set relayX_rev=1-relayX_fwd.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #6   Spotlight this post!  
Unread 17-02-2003, 00:15
Justin Stiltner's Avatar
Justin Stiltner Justin Stiltner is offline
The big guy
no team
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Blacksburg, Va.
Posts: 305
Justin Stiltner has much to be proud ofJustin Stiltner has much to be proud ofJustin Stiltner has much to be proud ofJustin Stiltner has much to be proud ofJustin Stiltner has much to be proud ofJustin Stiltner has much to be proud ofJustin Stiltner has much to be proud ofJustin Stiltner has much to be proud ofJustin Stiltner has much to be proud ofJustin Stiltner has much to be proud of
Send a message via ICQ to Justin Stiltner Send a message via AIM to Justin Stiltner Send a message via MSN to Justin Stiltner Send a message via Yahoo to Justin Stiltner
umm... im using &, and ~= and their working just fine in my code...
and they are used in the default code from I.F.
__________________
Justin Stiltner
Lead Robot Inspector, VCU Regional
Unmanned Systems Lab, Virginia Tech
KI4URQ
  #7   Spotlight this post!  
Unread 17-02-2003, 01:47
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
Quote:
Originally posted by Justin Stiltner
umm... im using &, and ~= and their working just fine in my code...
and they are used in the default code from I.F.
~= is not valid syntax. The editor complains about it and won't even tokenize. It also is not any of the four default codes, so I'm not sure where you saw it. As for &, it is not the correct operator to use here. Here's a quote straight from the Stamp Manual (page 153):
Quote:
The easiest way to avoid the kinds of problems this might cause is to always use a conditional operator with IF...THEN. Change the example above to read IF Flag = 1 THEN IsTrue. The result of the comparison will follow IF...THEN rules. Also, the logical operators will work as they should; IF NOT Flag = 1 THEN IsTrue will correctly evaluate to false when Flag contains 1.
This also means that you should only use the "named" conditional logic operators NOT, AND, OR, and XOR with IF...THEN. The conditional logic operators format their results correctly for IF...THEN instructions. The other logical operators, represented by symbols ~ & | and ^ do not; they are binary logic operators.
Finally, see any of the below threads for more info:

http://www.chiefdelphi.com/forums/sh...threadid=18007
http://www.chiefdelphi.com/forums/sh...hlight=bitwise
http://www.chiefdelphi.com/forums/sh...hlight=bitwise
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #8   Spotlight this post!  
Unread 17-02-2003, 11:32
Justin Stiltner's Avatar
Justin Stiltner Justin Stiltner is offline
The big guy
no team
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Blacksburg, Va.
Posts: 305
Justin Stiltner has much to be proud ofJustin Stiltner has much to be proud ofJustin Stiltner has much to be proud ofJustin Stiltner has much to be proud ofJustin Stiltner has much to be proud ofJustin Stiltner has much to be proud ofJustin Stiltner has much to be proud ofJustin Stiltner has much to be proud ofJustin Stiltner has much to be proud ofJustin Stiltner has much to be proud of
Send a message via ICQ to Justin Stiltner Send a message via AIM to Justin Stiltner Send a message via MSN to Justin Stiltner Send a message via Yahoo to Justin Stiltner
yea my bad on the first one.. that one doesent work*bops self in head*
__________________
Justin Stiltner
Lead Robot Inspector, VCU Regional
Unmanned Systems Lab, Virginia Tech
KI4URQ
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


All times are GMT -5. The time now is 04:27.

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