10-31-2008 10:43 PM
Take a look at this.
I took the code I had earlier and added in the boolean array cluster from Lynn's code. I noticed you had some values beyond index 9, but I couldn't figure out what they were. I made indices 10 through 15 be the characters a through f so that the display could show hex characters. But the code as written will never get to those digits.
I had modified my code earlier to make the background black and use larger LED segments that came together because I thought it was easier to read than the small bars on white background you had earlier. I added an 8th segment for the decimal point. I also modified the cluster so each segment had a label for its segment letter. That way the bundle and unbundle by name functions would work on the cluster.
I made the number of digits a control, so more digits can be shown. The display array would just have to be expanded to show more elements.
I hope you like it.
10-31-2008 11:46 PM
11-01-2008 02:50 PM
11-01-2008 10:04 PM
11-01-2008 10:26 PM
11-02-2008 12:33 AM
11-02-2008 02:37 PM - edited 11-02-2008 02:41 PM
This is getting to be scope creep.
First a number.
Second, decimals.
Third, negative numbers
....
![]()
I hadn't tried numbers less than 1 before. The scheme I was using to get to the first number by using log base 10 didn't work with those.
Instead, I am going to let the number to string function do the formatting, then build the digital display array accordingly. I note the location of the decimal point then strip it out since we do not want it to be its own character in the display. If you are using longer numbers, it may be necessary to change the format string for the format into string function to account for needing more digits.
See Attached.