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