I am currently trying to program our shooter using 1 Cim motor and 1 window motor. I am trying to set the Cim motor to be on just the Joysticks y axis and the window motor to the trigger on the joystick.
I have come up with setting up each as an individual motor and assigning them to different sections of the joystick.
I have, however, reached an impass as i am unsure of how to inizialize motors in the Begin.vi and how to use the buttons themselves to spin the motors.
If any one has any insight it would be appreciated.
The CIM motor and joystick both have a -1 to 1 range. You may need to flip the direction by multiplying by -1, or scale it by multiplying by a number less than 1.
For the button based motor control, determine exactly how you’d like the buttons and motor to behave. I suspect you’ll find other questions with attached images that do something very similar.
In Begin, you typically Open the motor and provide it with the PWM channel number. You then store the value giving it a useful name. That allows you to access it in other parts of the program using the same name.
i am sorr that i forgot to mention that our robot is configured to be in arcade drive mode and that the shooting motor and our indexer window motor are on the second joystick if you think this changes anything
I apologize, I am not sure what you mean by this. The code I linked to should work fine without any changes. First make sure that you are setting and calling the same Refnum in both the Begin and Teleop VI’s (the string constant wired to the upper left node in your motor and joystick VI’s). If these are all correct, it is hard to diagnose any problems without further details. Could you upload a copy of your Teleop and Begin VI’s?
When the above code was put on the robot it just sort of lurched and then did nothing after that
We went back and loaded a fresh driver code with no modifications on it to check to see if maybe something happened to the robot but it worked fine with the unmoddified program
I’m having the same sort of problem on our robot. When using JUST the default code for mechanum, everything works fine, but the moment I try to add initializing and running another motor to the code, all the motors stop working, and get blinking lights, as if they are receiving no input signal.
Just initializing the two Shooter motors in Begin causes the problem.
Things work when you only have a few motors defined, but then when you add more motors the problem appears. This is a clear indication that the Digital Sidecar is not receiving 12 volt power from the Power Distribution Board. Check the LED labeled “BAT” on the Digital Sidecar and make sure it’s lit (the 6V and 5V LEDs should be lit as well).
I have done this. All 3 lights are lit. When I get back to the robot, I will replace the digital sidecar and the module to see if that changes anything.