|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
[OCCRA]: Spikes on Cortex
I noticed that someone asked (in the Q&A) how to connect a Spike to the Cortex. Since I cannot reply there, I will help them here (in the general forum):
What I did: I took a standard PWM cable and cut the red wire. The SPIKE wants a gnd(black), sig(red), sig(white), where the first sig is REVERSE and the second is FORWARD. A Digital channel on the Cortex provides gnd(black), +5v(red), and sig(white). If you don't cut the red wire, then REVERSE will always be on and FORWARD will be determined by the digital output. If you connected a pneumatic valve to that, it would see 0v on the output and +12 on what should be it's ground, and would not work. If you need two: You can connect the red wire of each valve to the M+ and M- terminals on the SPIKE (the one on m+ will be "forward", the one on m- will be "reverse"), and the blacks to the ground block. Connect the black on the spike to a black on the digital bus, and the red and white on the spike to two digital channels (you would probably have to cut at least 2 PWM cables and solder them together to achieve this, or make your own PWM cable.) EDIT: If you want to use the second joystick to control, you have 12 buttons to map to. (you don't have to do this,this is what I did) I used an enumerated type to determine mechanism state, and set that based on buttons. (I had a stack of IF statements, each one set the state as appropriate) I then had an array of motor speeds and another of piston positions for each state Since the enum. maps names to integers, you can index the array with the state directly Last edited by apalrd : 20-10-2010 at 14:39. Reason: more detail |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [OCCRA]: spikes and cortex | bernieseaholm | OCCRA Q&A | 2 | 26-10-2010 18:23 |
| [OCCRA]: OCCRA VEX Cortex Test Program | marccenter | OCCRA Programming | 0 | 12-10-2010 22:23 |
| [OCCRA]: Assembly on the cortex | Fireball9199 | OCCRA Programming | 3 | 04-10-2010 21:35 |
| [OCCRA]: cortex power supply off/on | bernieseaholm | OCCRA Q&A | 1 | 23-09-2010 08:32 |