Quote:
Originally Posted by otherguy
I believe you have a scope problem.
You instantiate your jaguars as class variables (green lines), then create four new jaguar variables within the robotInit() method (red lines). You're not initializing the class variables as you may think. Basically you're telling the program that within the robotInit() class it should use the local copies of those Jag variables (red), instead of the ones the rest of the program knows about (green). Any reference to the Jag variables outside of the robotInit() method will refer to the ones that aren't initialized (green), and since they aren't initialized they won't be sending commands to any motor controllers.
Remove the "Jaguar" text thats highlighted red and that should fix your problem.
Read up on scope: http://sip.clarku.edu/tutorials/java/java.html#scope
|
Yup, he is right, you having that is like pretty much trying to make two jaguars of the same variable name, and in any programming language you can't simply do that.