128x32 OLED display


I am using a 128 x 32 OLED display on my project using the U8G2 library.

My project is a radio with a function to sweep radio station frequencies from 87.0 to 108.9FM.

My display does work when doing a forward sweep from 87.0 to 108.9 however when I put into a reverse sweep (going from 108.9 to 87.0) I get a problem on the display.

It starts off OK running from 108.9 down to 100.0 but then when it ticks over to 99.9 the display still shows the "1" from the previous number so then the display shows 199.9 down to 187.0 but it should only show.

My question is how can make it so that the number counts down properly without showing the "1" from the previous number.

Any help would be appreciated. I can upload pics of the problem if anyone wants to see them.


Brett Rogers

Print a leading space if less than 100.


Thanks AWOL. I had already tried that but it didn't work. I have now tried changing the font used and it has now worked. The display now goes from 100.00 down to 99.9 without the leading "1" from the previous number.

I was using u8g2_font_profont22_tn but then I changed it to u8g2_font_profont22_mf and it now works :slight_smile:

Kindest Regards,

Brett Rogers

Ah! Proportional fonts.

Other obvious option was - print more spaces (though why it would right justify instead of left is not obvious)!