|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Pulling Variables from Robot
So we are having some problems with variables in Command base programming. What we want to do is to create a variable in either Robot.Java or Robot.Map (or just any one class) that we can call from (i.e Robot.(variable name)) to be used in a command or subsystem. We just cant seem to be able to do just that. Anyone have any ideas as to why or for how we can do this?
|
|
#2
|
|||
|
|||
|
Re: Pulling Variables from Robot
In robot map you declare the constants for the robot.
For example: Code:
public static final int MOTOR_SPOT_1 = 1; Code:
RobotMap.MOTOR_SPOT_1 |
|
#3
|
|||
|
|||
|
Re: Pulling Variables from Robot
Quote:
Thanks, D |
|
#4
|
||||
|
||||
|
Re: Pulling Variables from Robot
Yes, removing final will allow you to change the value during runtime.
|
|
#5
|
|||
|
|||
|
Re: Pulling Variables from Robot
Perfect! Thanks!
D |
|
#6
|
|||
|
|||
|
Re: Pulling Variables from Robot
The final keyword in java is used when a variable value is known at runtime.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|