wayoda / LedControl

An Arduino library for MAX7219 and MAX7221 Led display drivers
Other
464 stars 243 forks source link

printNumber(int v) function in the examples #6

Closed LargoLobo closed 9 years ago

LargoLobo commented 9 years ago

Must assign "false" to the boolean variable "negative" up front. If not, it defaults to "true" and all the displays will be negative. Also, don't need to multiply v=v* -1; It doesn't matter, since you are building the answer one digit at a time separately, and the sign digit is assigned regardless of this statement.

wayoda commented 9 years ago

Must assign "false" to the boolean variable "negative" up front. If not, it defaults to "true" and all the displays will be negative.

Fixed. C(++) is not my hometurf. Thanks for pointing this out.

Also, don't need to multiply v=v* -1; It doesn't matter, since you are building the answer one digit at a time separately, and the sign digit is assigned regardless of this statement.

True but I left it in the demo code. I expect some readers have little programming experience so I try to make the code very explicit.

wayoda commented 9 years ago

@LargoLobo If you don't have any objections, I close this issue now?

Feel free to reopen it if you think the demo code needs to be improved in any other way. Thanks Eberhard