Quote:
Originally Posted by vgdude999
If you declare a talon object in map.java, you can just make new variables in the two other classes that point to the existing object.
Ex:
Talon motor = map.getMotor();
|
@sthreet: Or this, in which case map.java would have to initialize your Talon objects with the constants, e.g.
Code:
Talon motor = new Motor(PWM_PORT_ON_DSC);
For this purpose you may want to look into the
Singleton design pattern. Be careful that multiple classes aren't attempting to access the Talon object at the same time, which appears to be your initial problem.