|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
Re: Shooter Programming Help
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. Greg McKaskle |
|
#3
|
||||
|
||||
|
Re: Shooter Programming Help
To elaborate on what Greg said, I've attached a screenshot of how to initialize a motor in Begin.vi.
|
|
#4
|
||||
|
||||
|
Re: Shooter Programming Help
To build on the reply above me, I have attached very basic code for having the joystick trigger control a motor.
|
|
#5
|
|||
|
|||
|
Re: Shooter Programming Help
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
|
|
#6
|
||||
|
||||
|
Re: Shooter Programming Help
Quote:
That is fine. Just adjust the example I linked to accordingly. |
|
#7
|
|||
|
|||
|
Re: Shooter Programming Help
What should i connect the Motor set outputs too???
|
|
#8
|
|||
|
|||
|
Re: Shooter Programming Help
How should the out puts be set up because i ran the program but nothing seemed to work
|
|
#9
|
||||
|
||||
|
Re: Shooter Programming Help
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?
|
|
#10
|
|||
|
|||
|
Re: Shooter Programming Help
Quote:
|
|
#11
|
|||||
|
|||||
|
Re: Shooter Programming Help
I don't see anything obviously wrong with what you're showing us. What does it do when you run it? What do you want it to do instead?
|
|
#12
|
|||
|
|||
|
Re: Shooter Programming Help
Quote:
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|