View unanswered posts | View active topics It is currently Mon Oct 19, 2020 11:24 pm

Reply to topic  [ 2 posts ] 
Pneumatics code? 
Author Message

Joined: Mon Mar 23, 2015 10:50 am
Posts: 1
Post Pneumatics code?
Hi, I'm Grant from Vex Robotics team 8926. We just recently purchased a double action pneumatics kit. We use the double acting Pistons to switch gears on our lift. However, our programmer either doesn't know or doesn't care about how to use the pneumatics. He says all the code we have given him are for single action Pistons. Can anyone help me by telling me how to reference and activate the double acting solenoid to extend and then wait 5 seconds and then contract. Extending is plugged into the B hole on the solenoid. Thank you so much. He uses RobotC analog

Mon Mar 23, 2015 10:57 am
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 722
Post Re: Pneumatics code?
Programming a double-acting solenoid is actually pretty simple, and is very similar to programming a single-acting solenoid. Take a look at the code sample below, which is a modified version of the Pneumatics Sample Program (Basic_Pneumatic_Code.c) in ROBOTC:

#pragma config(Sensor, dgtl7,  solenoid,            sensorDigitalOut)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
   SensorValue[solenoid] = 1;  // ...activate the solenoid.
   sleep(5000);                        // Sleep for 5000 ms (5 seconds)
   SensorValue[solenoid] = 0;  // ..deactivate the solenoid.
        sleep(5000);                        // Sleep for 5000 ms (5 seconds)

This will activate the solenoid on digital port 7 for 5 seconds, then deactivate the solenoid for 5 seconds.

Check out our Blog! And our Facebook page!
Need help? Take a look at our updated help documentation and the ROBOTC Forums.

Wed Apr 01, 2015 12:24 pm
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.