Quote:
Originally Posted by John_1102
This code gave me a VERY constant RATE on my graph.
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;
}
}
|
Rather than putting the exact same post in two different threads, it's probably better to post a link:
http://www.chiefdelphi.com/forums/sh...9&postcount=27
http://www.chiefdelphi.com/forums/sh...6&postcount=29