Go to Post I personally think that everybody on the team is important. No matter what, every single student, mentor, teacher put their effort all year long to get the team going. So in my opinion, Credit goes to everyone. - Arefin Bari [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 07-01-2014, 22:55
Lemon's Avatar
Lemon Lemon is offline
Builder of Robots
AKA: Andrey (Gooby)
FRC #2383 (Ninjineers)
Team Role: Electrical
 
Join Date: Jan 2014
Rookie Year: 2011
Location: Ft.Lauderdale, FL
Posts: 25
Lemon is an unknown quantity at this point
Programming a Vex Cortex in RobotC to Control a Pneumatic System

Hello all,
So before build season our team was doing a couple side projects that we now, at the start of build season, wish to finish up. One of these side projects includes pneumatics, wired and set up to the typical FRC rules and style, which we would like to program to run in a certain sequence. Since we had a vex cortex controller lying around, we decided to attempt to use that to run the entire sequence. However, being completely unfamiliar with the Vex Cortex, nor any programming language in relation to it (For our FRC robot we have tended to stick to labview in the past), I have become quite lost. My main question is how does one go about programming a Spike Relay in RobotC? Am I simply missing libraries or would I have to construct them myself? I had attempted to look up some sample code or any tutorial or such but wasn't able to find much help, other then the sample here: http://www.stemrobotics.org/mediawik...itle=VEX_Spike which does not compile, stating errors in the code, however I may just have the wrong syntax or just am starting the code incorrectly or incorrectly changing variables (as I said, I have absolutely no knowledge in this area) And as a second question, since our pneumatic system contains a compressor, I was wondering if it is possible to wire and program the Nason Pneumatic Pressure Switch with the Vex Cortex? Thanks. Any and all help or knowledge would be appreciated.
  #2   Spotlight this post!  
Unread 08-01-2014, 18:36
nightpool's Avatar
nightpool nightpool is offline
robotRectifier
AKA: Evan
no team (formerly of CORE 2062)
Team Role: Alumni
 
Join Date: Oct 2011
Rookie Year: 2011
Location: Waukesha, WI
Posts: 81
nightpool is on a distinguished road
Re: Programming a Vex Cortex in RobotC to Control a Pneumatic System

The code you linked is for EasyC. The spike is just a normal PWM output, the important thing to note is the wiring:
Code:
                 ,--W   \
                 |  R   |  digital output 1
                 |  B   /
         /  W----'       
to Spike |  R----.       
         \  B--. '--W   \
               |    R   |  digital output 2
               '----B   /
  W,R,B = White, Red, Black
From there, all you need to do is make two robotc digital outputs (in the robot setup wizard) and assign them the correct values for forward, stop, and reverse

Forward: 1, 0
Reverse: 0, 1
Stop: 0, 0

Where 1, 0 means to set the first digital output to 1 and the second to 0.

WPILib also includes a kOn enumerated type, for 1, 1, but I'm not sure where it would be used.
__________________
Proud alum of CORE 2062.
www.core2062.com
  #3   Spotlight this post!  
Unread 08-01-2014, 22:15
Lemon's Avatar
Lemon Lemon is offline
Builder of Robots
AKA: Andrey (Gooby)
FRC #2383 (Ninjineers)
Team Role: Electrical
 
Join Date: Jan 2014
Rookie Year: 2011
Location: Ft.Lauderdale, FL
Posts: 25
Lemon is an unknown quantity at this point
Re: Programming a Vex Cortex in RobotC to Control a Pneumatic System

Okay Thanks, It seems I have got the spikes to properly activate using the vex cortex, my only other question then is can I connect the Nason pressure switch to the vex cortex? Do I treat it just like any other digital input or would something special have to be done coding or wiring wise?
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:07.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi