View Single Post
  #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