I’ve passed couple of hours trying to make one globe motor work with joystick buttons:(
I want that #2 makes the motor spin right and the #4 makes the motor spin left.
I open a Get from joystick and I set the buttons I plan to use. Then I open a loop where false is empty but in True I add an open Motor and I can’t seem to find the way to connect them all together… And to specify where to should each one should spin…
If anyone can explain me or show me a small SS I would really appreciate it:)
I posted a picture of some code that will do this for you that is simpler than using a case structure. It uses some logic gates in the code and ensures that the relay is set only once during each loop execution. If you are controlling jaguars or victors than you can just change the set relay to set speed and submit constants (255, 127, or 0 or any degree thereof) to the true/false cases for the select blocks.
Here is the thread.
feel free to post if you have any more questions! Hope this helps!
sure okay. To do this I would use code similar to what i posted in the picture and instead of assigning forward/ reverse/off to the block selectors use integer values. 255 would be full power in one direction, 0 would be full power in the other direction and 127 would be off. Also, instead of using the set relay use the set speed to connect to the output of the block selector.
It might be easier to just use a relay instead of a jaguar unless you really need to control speed.
sorry about that. they are also known as the spikes. They cannot be used to power the CIMs (against the rules), but they can be used to power smaller motors like the globe motors. On the spike there is M+ and M- on one side. On the other side there is 12V and GND. The M+ and M- is for the motor leads. the 12V and Gnd is for power to the motor. there is also a three terminal header in the spike. it is rectangular and a pwm cable plugs into that which delivers the signal from the digital I/O sidecar to the spike.
The relay is pretty much just an on/off or forward/off/reverse device. There is no speed control. Determining if you need speed control depends on the application for the motor.
In the WPI libraries there are VIs written for controlling the spike. I think they are under WPI Library–>Actuators–>Relay. By putting those VIs into the code and then clicking the question mark in the right hand corner and hovering over the icon you will get a description of what he inputs and outputs are to the vi.