typecasting the returned unsigned long shows that it returns an overflown unsigned long
it seems that the calculation in the function is interrupted and this is resulting to cause the substraction giving out a negative number, although im not really experienced.
Code is run on Arduino Micro
I have exact the same issue using an Arduino Every. I wil take a look at the method. I'm not that experienced to, but maybe i can make something out of it.
typecasting the returned unsigned long shows that it returns an overflown unsigned long it seems that the calculation in the function is interrupted and this is resulting to cause the substraction giving out a negative number, although im not really experienced. Code is run on Arduino Micro
console output: