The above referenced line uses the variable 'i' for the value from the velocity array, but shouldn't it be 'j' instead? Using i just adds the same value from the same index for the window size. It doesn't actually use all the values in the array as I would expect. Same problem in both of the methods.
https://github.com/ftPeter/RomiPi/blob/cc958aed5e19ca468e657f5ba309f9c5a3e4fc76/Arduino/Romi-RPi-I2CSlave/motor_pid_control.ino#L33
The above referenced line uses the variable 'i' for the value from the velocity array, but shouldn't it be 'j' instead? Using i just adds the same value from the same index for the window size. It doesn't actually use all the values in the array as I would expect. Same problem in both of the methods.