FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to run 2 more Jaguar controllers (from PWM 3 and PWM4) but the 4 pwm's do not work at the same time

I am trying to open 2 more Jaguar controllers (from PWM 3 and PWM4) aside the ones in the default code (PWM 2 and PWM 1) but when i load the code on the cRIO, only the jaguars connected to PWM 3 and PWM 4 have their lights turn solid. When i remove the code corresponding to the pWM3 and pwm4, i get the pwm 1 and pwm 2 working. Seems it is not possible to have the 4 pwm's running at the same time. any help please.

Here is a snippet of the code in the teleop

0 Kudos
Message 1 of 7
(5,724 Views)

You had the right idea including a screen shot, however you included too little of the VI to be able to tell what might be wrong.  Please include the part of the VI where you actually open all of the motors.  Perhaps just attach your VIs.

0 Kudos
Message 2 of 7
(3,791 Views)

Thanks for the quick answer.

So here are the vi's concerned. I open the jaguars in the begin vi, i control them in teleop and close them in finish.

Thanks.

Download All
0 Kudos
Message 3 of 7
(3,791 Views)

Looking at your Teleop VI, there are problems with the while loop within it:

1. It shouldn't be in Teleop, since Teleop already gets called over and over by the main loop.

2. When you do use a while loop, you should always include timing in it.  Your while loop is running full speed which will use 100% of the CPU.

0 Kudos
Message 4 of 7
(3,791 Views)

So where do you suggest i put this portion of code which is actually in the whilw loop since i need those 4 motors to keep running atthe same time in teleop mode, two for the robot drive and two for the my shooter! Thanks

0 Kudos
Message 5 of 7
(3,791 Views)

That code can stay in Teleop, you just need to remove the while loop.

0 Kudos
Message 6 of 7
(3,791 Views)

worked fine. Thank you!

0 Kudos
Message 7 of 7
(3,791 Views)