Can you describe what the problem with the arm is? Just looking at the code, once the arm starts moving, the arm will always be moving in one direction or the other, which might not be desirable.
Here’s a number of non-code related things that could cause a motor not to move:
You didn’t enable the robot on the driver station
You didn’t plug the PWM cables from the victor to the digital sidecar PWM ports
The PWM cable missed the connector inside the shroud on the victor (this is very easy to do).
You didn’t power the digital sidecar
The digital sidecar isn’t plugged into the digital module in slot 4 of the cRIO
You have the PWM cables plugged in backwards. B is for black wire.
You have the PWM cables plugged into the wrong PWM ports on the digital sidecar.
The circuit breaker is immediately tripping.
The speed controller isn’t powered.
The motor isn’t connected to the speed controller.
Knowing what the LED is doing on the speed controller would help narrow down the problem
Are you sure that 0.2 will overcome the inertia of the arm? Do the motors hum or get warm at all? You can test the output side of the victor with a multimeter.
The code shown is too simple to be ‘wrong’. (though the addition of else … 0.0 is a good idea).
The initialization issue mentioned by Jared341 would throw an exception (null pointer) in most, but not all cases. You need to make sure the object stays in scope all the time. Its not clear from your response to him if it does or not. Are you leaving the scope of the declaration right after setting the motor for instance? That would show no errors and not work.
An object only exists when in scope. For instance if you declare a variable in a method it is created and destroyed when the method is entered and exited.
I usually declare a motor in a class and call that classes constructor from my top level class (I use SimpleRobot usually) that way the motor exists from when the class is first instantiated and never goes away until exit.
The scenario I mentioned in the previous post only occurs when you do something like
public void motorStuff(){
motor = new Jaguar(1);
Jaguar.set(0.5);
}
The motor controller object will go away before it has time to do anything. Even if you call it repeatedly it won’t last long enough to run for more than microseconds.
It doesn’t seem to be the problem from the code you posted, but it doesn’t hurt to ask.
To me, this remains the most conspicuous clue. A blinking orange speed controller is one that does not have a working connection to a properly configured PWM port on the digital sidecar. Be absolutely, positively sure your PWM connector is fully seated at both ends.
Try connecting the arm to a pwm port with an address less than 9 (ie. 1 to 8). I have not personally used so many motors in the past but the schematics show that channels 9 and 10 are wired slightly differently than 1 - 8. You should try using a higher pulse duty cycle. Finally check to make sure that the black wire in the WRB cable is in the correct position. Victors allow the wire header to be inserted backwards.