|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Dist/Speed Function Question.
For this year's competition we are going to have a shooter that has a sensor that reads how far it is from the goal and then by means of a predetermined array select the appropriate speed setting.
The only problem is the set speed method requires a double and I'm not sure how to make an array of doubles. it doesn't seem to be simply, double SPEED = new double[]; I was wondering if I was going to have to use an ArrayList to achieve my goal. |
|
#2
|
||||
|
||||
|
Re: Dist/Speed Function Question.
There are two ways of doing this. If you can determine a mathematical function, use that. Otherwise, try this:
Code:
final double[] SPEED = {double1, double2, double3...};
Code:
double[] SPEED = new double[SIZE]; |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|