Go Down

Topic: Fast 7-segment number display for TFT  (Read 5522 times) previous topic - next topic

Yorkshire_Jon

Well, this is the best bit of code Ive stumbled across.  Im a newbie to this Arduino programming and Id never of figured this out.  I was struggling with dreadful refresh times using big numbers and the Adafruit library.

Thanks a million.  My project can now use the Adafruit 1770 2.8" TFT display and has lightning quick refresh' now:)


One question though, how can I justify the numbers to the right?  For example, I need to display altitude.  For the most part the display will show 2 digits, occasionally there will be a <0m value and >1000m value, so Id like the 10's and 100's numbers to always be in the same position and the 1000's and -ve sign to appear and disappear as required without moving the 10's and 100's digits.

Many thanks.
Jon

wzaggle

Hey,

Easiest way to right justify is just to use -4 for the last number in the call.  This says always use four number places and the - will blank any leading zeros rather than pad the 1000, 100 or 10's place with zero.


Hope that helps.

William

max44

i can only seem to have the number 8 shown. regardless of the number i want to display

CrossRoads

@max44,
What is your hardware & software setup?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

FissionMan

I need to use this to display the value of an analog input. It will be a voltage that needs to have a decimal. Is that possible with this?

Go Up