|
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
|