Quote:
Originally Posted by John_1102
I just got a VERY constant rate from using this function I wrote.
Code:
public void getSpeed(){
samples[counter] = Shooter_En.getRaw();
counter++;
Shooter_En.reset();
if(samples[9] > 0){
counter = 0;
for(int i = 0; i <= 9; i++){
sum = sum + samples[i];
}
AVG = sum / 10;
Rate = AVG / 0.48;
sum = 0;
}
}
|
Do you notice that the speed you get using this method is slow to respond to changes?