View Single Post
  #14   Spotlight this post!  
Unread 10-09-2008, 15:57
BornaE's Avatar
BornaE BornaE is offline
Registered User
FRC #0842 (Formerly 39)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Gilbert, Arizona
Posts: 359
BornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant future
Re: Servo 'smoothing'

This would impreve your responsivness: (I just tought of it, not tested before)
Code:
static int temp[5]=0;

temp[4] = temp[3];
temp[3] = temp[2];
temp[2] = temp[1];
temp[1] = temp[0];
temp[0] = Get_Analog_Value(ana_in_yy);

pwmXX = (temp[0]/2 + temp[1]/4 + temp[2]/8 + temp[3]/16 + temp[4]/32)/4;
__________________
-Borna Emami
Team 0x27