Question: Using C programming You have a plan to build a games console controller that captures the hand gestures of the player. The players movements and

Using C programming

You have a plan to build a games console controller that captures the hand gestures of the player. The players movements and gestures are sensed using an accelerometer connected to one of the ADC pins of an Arduino. You have already written all the necessary code but have yet to include any kind of smoothing for the accelerometer signal.

Your task now is to write the accelerometer smoothing function. The function must take each new sample as input and return the average of 4 consecutive samples without introducing a significant lag. (Hint: use a moving average.)

Write an implementation of this function where the function prototype is of the form:

int SmoothSensor(int sensorReading);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!