View Single Post
  #2   Spotlight this post!  
Unread 29-03-2008, 08:12
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: Problem in Pneumatics programming

Quote:
Originally Posted by beefy23 View Post
I have a problem trying to cause the piston going forwards and backwards.

What I`ve tried to do is to move the piston backwards when the user clicks on the joystick`s trig and to move the piston forwards when the user get rid of the joystick`s trig.

I had a problem which seemed ambiguous for me and I couldn`t find the error, it compiled successfully.

I made sure the spike is plugged in the proper relay, and the joystick is plugged in the proper port.

Here is the code:

if(p1_sw_trig)
{
relay1_fwd = 0;
relay1_rev = 1;
}
else
{
relay1_fwd = 1;
relay1_rev = 0;
}

but it doesn`t do anything .
Your software is entirely correct. Unfortunately the connectors on the Spikes are very finicky, so you might try plugging them in a few times. But, before you do that, I suggest taking a volt meter or an led and seeing if the fwd and rev pins are being set/unset. If they aren't, you can test it at the pin too. If it isn't working there, check with dashboard to see if your button is working and is showing up where your software thinks it should be.

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08