Hi, couple of quick ones that I have meant to post for some time. With ref to the current eChookCode.ino posted on GitHub:
1. Line 283: lastShortDataSendTime - millis(); //Give the timing a start value. ----------- believe this should be: lastShortDataSendTime = millis(); //Give the timing a start value.
2. Lines 174 and 180: int arrays are used for storing current and speed values for subsequent smoothing. Consequence is that smoothed current values are always something .00, .25, .50, or .75, and smoothed speed values are always something .00, .33, or .67. Changing to float arrays provides greater granularity in the smoothed values. Although using floats results in greater computational cost, we have not seen a problem having made this change on our eChook.
Had it on my list to also report that speeds were always 1/3 of what they should be, but that was fixed back in Feb! Yes, it has taken me that long to write this post.
1. You are absolutely right, typo by me there. Thankfully it makes virtually no difference to behaviour but I will definitely correct it!
2. Again, you're right. When we released the code we wanted to leave areas for improvement, which proved quite difficult when it also needed to be fully functioning code. In hindsight maybe that feels a little petty - converting to a float start does give better data and as you say, there are no issues with the increased computation.
Apologies for the speed issue! I spent too long thinking it was a conversation issue in the app or website before going and checking the Arduino code...