View Single Post
  #2   Spotlight this post!  
Unread 17-02-2007, 17:48
Shinigami2057 Shinigami2057 is offline
Slackware Is Your New God (Mentor)
AKA: Harry Bock
FRC #1350 (Rambots)
Team Role: Programmer
 
Join Date: Oct 2006
Rookie Year: 2006
Location: Johnston, RI
Posts: 106
Shinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really niceShinigami2057 is just really nice
Re: programming the pneumatics

I can't help you if you're using EasyC, but if you're using Microchip's toolchain, you can program spikes to operate a solenoid and thus control airflow to your cylinders through the relayX global aliases.

For example:
Code:
if(p1_sw_trig) { /* port 1 joystick trigger is depressed */ 
    relay1_fwd = 1; /* Output +12V to your solenoid, allowing air flow in one direction*/
    relay1_rev = 0; /* No output to -12V */
} else { /* Trigger released */
    relay1_fwd = relay1_rev = 0; /* No output, solenoid changes position and flow reverses */
}
Basically, just use the relays to control +12V and -12V to solenoids or pumps or whatever have you. Never put relayX_fwd and relayX_rev both to 1, however. Sorry if I can't give a better description... I'm totally wiped from last night (got home at 3:45AM after a few disasters...)
__________________
One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs.