smaffer / vgax

VGA library for Arduino UNO
430 stars 81 forks source link

Use all colors in random pixel example and fix vtimer overflowing #23

Closed miracoli closed 3 years ago

miracoli commented 3 years ago

Hello,

the vtimer almost always overflows during the calculation in the micros() function, because the calculation is done with unsigned / 16-bit precision and then the result is converted to unsigned long / 32-bit precision. Overflow also occurs in the millis() function after ~65 seconds. Both can be easily fixed by using unsigned long instead of unsigned for vtimer.

Best regards