1.3" OLED text placement on screen

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
drabadue
 
Posts: 1
Joined: Tue Jun 17, 2014 11:10 am

1.3" OLED text placement on screen

Post by drabadue »

I received my 1.3" OLED screen in the mail and had it up and running in no time. I want to thank Adafruit for the instructions and tutorials. In the package was a 7 pin header (instead of 8) with the screen, but I am running it with I2C anyway, so it wasn't a big deal. I have modified some of my existing code to change serial.println to display.println and it works well. On my display, I am outputting numbers that are formatted as X.X and XX.X. When I get to 9.9 and the next digit is 10.0, the display will push the numbers to the right to make room for the extra digit. I am wondering if there is a way to basically fix the position of the decimal point on the screen? I would like to have all the numbers line up on the same spot as they are displayed. This code is in the loop, so it updates constantly and watching it bounce between the single and double digits is a tad hard on the eyes.

I know that I can create an if-statement to check and see if the number is greater than 10, to reset the x and y position on the screen. But I wanted to see if maybe there was a command to do this automatically.

Also, does anyone have a list of commands for this display? Or possibly the pixel width and height of font at different sizes?

-Darren

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: 1.3" OLED text placement on screen

Post by adafruit_support_rick »

You pretty much either have to do as you said - change the cursor position if the number is >9.9, or you have to print a space in front of numbers that are <= 9.9

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”