gavinlyonsrepo / TM1638plus

An Arduino library to drive TM1638 seven segment modules.
https://gavinlyonsrepo.github.io/
GNU General Public License v3.0
79 stars 25 forks source link

displayHex fix #18

Closed hastypete closed 2 years ago

hastypete commented 2 years ago

displayHex(16) should show zero, but shows 1 (since of course '0' comes after 'F') That way no matter what number you send, you will see the lower nibble correctly.

hastypete commented 2 years ago

Here is fix: Add a line to displayHex as such: uint8_t offset = 0; hex = hex % 16; <<<< This is the added line. Mod makes sure no matter what the value is it will be 0-15 if (hex <= 9)

For model 1. I don't have model 2 to work with to fix that.

hastypete commented 2 years ago

I'm learning how to do pull requests from someone. This is my first try. I hope it is good.