Quote:
|
Originally Posted by gabrielse
We just bought the double action cylinder kit from Vex Labs. We want to program them in EasyC but we can't find any documentation. Please help.
|
Since the Vex Pneumatics are
beta parts from VexLabs, there is no documentation included with EasyC on how to program the pneumtics. However, fear not - the pneumatics are easy to program. All you need to do is plug the solinoids into the Digital Output ports. (
Not the motor ports!) In EasyC, use the
SetDigitalOutput() block and to change the state of that digital output port. In the following code snippet from EasyC, the SetDigitalOutput will toggle the solinoid state to 0 and then 1 and then back to 0 every second. Whenever the solinoid changes state, the pneumatic cylinder will move to the other limit of its travel.
Code:
while ( 1 )
{
SetDigitalOutput ( 16 , 1 ) ;
Wait ( 1000 ) ;
SetDigitalOutput ( 16 , 0 ) ;
Wait ( 1000 ) ;
}