![]() |
Code Not Working
Hi,
The following code does not work on the new RoboRio. The original code WORKS on the old cRIO. All I did was update how Robot Drive Works as per the WPI Screen Steps Live Website. Information as to what does not work is as follows: 1) The program builds correctly. 2) The computer connects to the Robo Rio. 3) The joystick is detected. 4) When the joystick is moved, nothing happens. Here is my code: Code:
package org.usfirst.frc.team4687.robot;Thanks all. PS: Is there any way to run System.out.println() statements as there was in Netbeans? Can I just type System.out.println() and it will print to the eclipse console each time it is called? |
Re: Code Not Working
Starting this year the "first" joystick is index 0, not 1. So you might need to move the joystick to slot '1' from slot '0' in the DS. Or just change the constructor param to '0' from '1'.
|
Re: Code Not Working
println ouput should land in the riolog window.
Look for "Riolog" at... http://wpilib.screenstepslive.com/s/...console-output |
Re: Code Not Working
I tried switching the joystick to new Joystick(0); and nothing happened again. Anything else that looks off?
|
Re: Code Not Working
I am very confused why you have two RobotDrive instances, but I would recommend checking the lights on the Jaguars to verify they are receiving commands.
EDIT: I re-read it and found the error. operatorControl() is only called once. You should replace "if" with "while" to make it run constantly until telop is finished. Also add a Timer.delay(0.05) at the end to free up the cpu. |
Re: Code Not Working
Thanks Joey, that was it. I must have written it wrong when copying the code over.
|
| All times are GMT -5. The time now is 02:38. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi