Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

displayHex fix #18

Closed
hastypete opened this issue May 19, 2022 · 2 comments · Fixed by #19
Closed

displayHex fix #18

hastypete opened this issue May 19, 2022 · 2 comments · Fixed by #19
Labels
enhancement New feature or request

Comments

@hastypete
Copy link
Contributor

hastypete commented May 19, 2022

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
Copy link
Contributor Author

hastypete commented May 19, 2022

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
Copy link
Contributor Author

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

@gavinlyonsrepo gavinlyonsrepo added the enhancement New feature or request label Dec 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants