Project - Simple 7 segment display using Image and Bitmaps for GLIDE

I just posted Simple 7 segment display using Image and Bitmaps for GLIDE on Codeshare. Feel free to discuss and make suggestions here.


I’ve just realised that the class can’t display negative numbers. :frowning:

I am working on an update so will post this once tested and working.

1 Like

How are you handling the decimal point for floating point?

That is working. You set the number of digits before the point and the number after. The software then creates the correct format string to create the string to display.

I have it working on a project just now with 12 digital displays and it looks great. Not all the sensors are installed yet but the display looks and updates every second. This is using the small LED in the set.


Indeed it does. Nice job, sir!

Can I ask how you originally generated the LED images?

I found a free bitmap of an 8 and then I edited that to make it blank and the flood filled each segment. I then joined them all together to make it one bitmap.

1 Like

Turns out my concern wasn’t one I should have worried about. I was concerned that my resizing of your sample images to my desired height would lead to strange pixel counts per character - but no, not a concern :slight_smile:

edit: Love it when I say that… OK, so it turns out that the calculation of the division line is good, it is a whole number with respect to the image width. But there is definite ghosting in the image division, if I count up the digits the character moves slightly right each time. I’m going to have to think harder on that problem (when I’m not half asleep like now)

Edit edit. Looking at the code, not thinking of a random number that I thought was correct, shows me that the division does not result in said whole number and I need to do non-linear reshaping of the image size.

As usual Dave, this is a cool project and a quick and easy thing to use - thanks! And thanks for your XML help too

Just wanted to check the interaction between numOfDigits and decimalPlaces. I initially wasn’t sure what the digit count would be, and if that included space for a negative sign if needed. I’ve settled on 3 and 1 for my display, which gives me 3 before the decimal place and 1 after, with no explicit sign location - so I only get a sign visible if the value is -99.9 and greater. Is that the way you expected it to work?

Yes. It works in much the same way as you get with the C/C++ string format where if you don’t use the + to tell it to show this so a 3 digit before the point will only show 2 digits if the number is negative.

in this case I think your code drops the minus sign… I will run my test harness again to verify