I have a GPS that I am using to get the speed of an implement and then control come solenoids based on the speed and a switch case programmed into the ardunio. I am trying to smooth the GPS responses by averaging the numbers. I understand that I could simply make them and int or take less readings but .25 MPH matters to a point (660 mistakes per hour which is within tolerance).
I have looked at endless sketches and read as many things that DEV has had to say about GPS.
I found this code in one of him examples:
static uint16_t averageKnots = 0;
averageKnots = (averageKnots * 3) / 4 + knots;
knots = averageKnots / 4;
It isnt making mathematical sense to me. Can someone explain this.