View Single Post
  #9   Spotlight this post!  
Unread 04-03-2007, 23:19
Neo3One3 Neo3One3 is offline
Registered User
AKA: Nick
FRC #0175 (Buzz)
Team Role: Driver
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Enfield, CT
Posts: 21
Neo3One3 is a name known to allNeo3One3 is a name known to allNeo3One3 is a name known to allNeo3One3 is a name known to allNeo3One3 is a name known to allNeo3One3 is a name known to all
Re: PROGRAMMING PNEUMATICS

I had a similar issue when programming the pneumatics for our upper/lower claws, wrist, extension, and lateral drive. Let me show you how I solved the issue.

Code:
if (CLAW1IN == 1 && clawTimer < 3)
	{
		clawTimer++;
	}
	else if (CLAW1IN == 1 && clawTimer >= 3 && clawTest == 0)
	{
		CLAWFWD = !CLAWFWD;
		CLAWREV = !CLAWREV;
		clawTest = 1;
	}
	else if (CLAW1IN == 0 && clawTimer >= 3)
	{
		clawTimer = 0;
		clawTest = 0;
	}
In this case we use double action solenoids, so if you just use single ignore the CLAWREV. The clawTimer is used as a measure of necessary depression of the trigger to create a change (eliminating accidental presses) and clawTest is a signal to keep the values from changing again. However, you do need to make sure for doubles that you initialize them as 1, 0, or 0, 1 to begin with, or you'll get 0, 0, and 1, 1 values for the solenoid, I.E. nothing happening.

EDIT:
Oops, forgot to fill in for the definitions.

Code:
#define CLAW1IN p1_sw_aux1
#define CLAWFWD relay2_fwd
#define CLAWREV relay2_rev
__________________

Go Buzz!