Tell us about yourself!
I recommend looking at the factory supplied arduino software code, and initialising the "lastTime" parameter to zero. Also, note that the the "SampleTime" parameter apparently has units of seconds, while the "timeChange" parameter has units of milliseconds. But yet, there is a line in the code that "magically" compares these two parameters (which have different units). Appears to be a mistake. It's the line that says:if(timeChange >= SampleTime)Also, note that the parameter "dt" has units of milliseconds as well.