View Single Post
  #2   Spotlight this post!  
Unread 15-11-2011, 21:57
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: [OCCRA]: Spike Relay and Cortex

Yes, that is possible.

I took a standard PWM cable, and used a scribe to pull out the red (center) wire from the Cortex end, and put it into another PWM cable shell. I plugged the two of them into a pair of digital ports.

Because I was running some automation on them, the driving state is a typedef enum (with states for hoodFORWARD,hoodREVRSE,and hoodOFF). You don't need to do this, and simply getting a joystick button and setting it to a digital output in code should work. Don't forget to open the IO configuration and set those digital channels as outputs.

While I don't have easyC in front of me (I would have to boot up my windows laptop do use it...), there is a function called joystick-to-digital or something like that which can be used to directly map a joystick button to a digital output. Placing that in your main loop will allow you to control your spike, you will need two buttons (one for each direction).
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote