Rev 1080 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1080 | Rev 1097 | ||
---|---|---|---|
Line 242... | Line 242... | ||
242 | void Mean(void) |
242 | void Mean(void) |
243 | { |
243 | { |
244 | static int32_t tmpl,tmpl2; |
244 | static int32_t tmpl,tmpl2; |
Line 245... | Line 245... | ||
245 | 245 | ||
246 | // Get offset corrected gyro readings (~ to angular velocity) |
246 | // Get offset corrected gyro readings (~ to angular velocity) |
247 | Reading_GyroYaw = AdNeutralYaw - AdValueGyrYaw; |
247 | Reading_GyroYaw = AdNeutralYaw - AdValueGyrYaw; |
248 | Reading_GyroRoll = AdValueGyrRoll - AdNeutralRoll; |
248 | Reading_GyroRoll = AdValueGyrRoll - AdNeutralRoll; |
Line 249... | Line 249... | ||
249 | Reading_GyroNick = AdValueGyrNick - AdNeutralNick; |
249 | Reading_GyroNick = AdValueGyrNick - AdNeutralNick; |
250 | 250 | ||
251 | // Acceleration Sensor |
251 | // Acceleration Sensor |
252 | // sliding average sensor readings |
252 | // sliding average sensor readings |
253 | Mean_AccNick = ((int32_t)Mean_AccNick * 1 + ((ACC_AMPLIFY * (int32_t)AdValueAccNick))) / 2L; |
253 | Mean_AccNick = ((int32_t)Mean_AccNick * 1 + ((ACC_AMPLIFY * (int32_t)AdValueAccNick))) / 2L; |
Line 254... | Line 254... | ||
254 | Mean_AccRoll = ((int32_t)Mean_AccRoll * 1 + ((ACC_AMPLIFY * (int32_t)AdValueAccRoll))) / 2L; |
254 | Mean_AccRoll = ((int32_t)Mean_AccRoll * 1 + ((ACC_AMPLIFY * (int32_t)AdValueAccRoll))) / 2L; |
255 | Mean_AccTop = ((int32_t)Mean_AccTop * 1 + ((int32_t)AdValueAccTop)) / 2L; |
255 | Mean_AccTop = ((int32_t)Mean_AccTop * 1 + ((int32_t)AdValueAccTop)) / 2L; |