0.96" i2c OLED library screen flip?

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
0miker0
 
Posts: 60
Joined: Mon Sep 12, 2011 8:13 am

0.96" i2c OLED library screen flip?

Post by 0miker0 »

I'm using the graphics library for the 0.96" OLED display with great results and I was wondering if it is possible to flip the thext and graphics on the entire display 180 degrees? An older library I was using was flipped so my buttons were located on the other side of what they are now.

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

Re: 0.96" i2c OLED library screen flip?

Post by adafruit_support_rick »

You can call the setRotation library function with a value in the range 0 to 3. The values specify rotations of 0, 90, 180, and 270 degrees.

User avatar
0miker0
 
Posts: 60
Joined: Mon Sep 12, 2011 8:13 am

Re: 0.96" i2c OLED library screen flip?

Post by 0miker0 »

I'm not sure if that will globally rotate all or selected items. I did a bit of digging and found this:
http://forums.adafruit.com/viewtopic.php?f=47&t=25438
I modified the two lines in my Adafruit_SSD1306.cpp file and ran the code but it did not rotate the screen 180 degrees. It still looks exactly the same.

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

Re: 0.96" i2c OLED library screen flip?

Post by adafruit_support_rick »

Oh, you've got the 0.96" monochrome OLED?

Not sure why setRotation would have no effect - all drawing goes through the library function drawPixel, which checks the rotation.

When you modified the code according to the other thread, did you modify it in the right section? There are two #ifdef conditional compilation sections which contain those instructions:
#if defined SSD1306_128_32
and
#if defined SSD1306_128_64

You want to modify the #if defined SSD1306_128_64 section.

User avatar
0miker0
 
Posts: 60
Joined: Mon Sep 12, 2011 8:13 am

Re: 0.96" i2c OLED library screen flip?

Post by 0miker0 »

You are correct. I modified the two lines under just one of the two displays. Never saw the other display section. Got it working now.
Thank You!

User avatar
Simon_A
 
Posts: 6
Joined: Sat Oct 28, 2017 6:16 pm

Re: 0.96" i2c OLED library screen flip?

Post by Simon_A »

Hi,

I am still struggling a little with the rotation of a SSD1306 OLED 128x64 on I2C using a Raspberry Pi

I have managed to get the OLED up and running with the helpful tutorial at https://learn.adafruit.com/ssd1306-oled ... ack/wiring

I am wanting to rotate the entire display 90deg to show text in portrait mode. I have read above, but still a little confused as to where to change the code :(

Could you please let me know where and what to change either in the library or program code?

Much appreciated

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

Re: 0.96" i2c OLED library screen flip?

Post by adafruit_support_rick »

The previous posts in this thread refer to the SSD1306 library on Arduino. From what I can see of the R Pi python library, it doesn't support rotation.

User avatar
Tinuviel
 
Posts: 2
Joined: Thu Dec 27, 2018 12:05 pm

Re: 0.96" i2c OLED library screen flip?

Post by Tinuviel »

Hi

I know this is ooooold threat but it's still relevant. So I have PiOled adafruit screen. I want to simply show three values vertically. How can I can force it to rotate 90deg from default? I see that ardurino libary contain rotation section:
https://github.com/adafruit/Adafruit_SS ... SD1306.cpp

but I can't see anything like that in Rpi one:
https://github.com/adafruit/Adafruit_SS ... _SSD1306.h

There must be some way for doing that - all I need it to print three twodigits number one under the other:
XX
YY
ZZ

any ideas? I will try to "hack it" with fliped fonts : ]

User avatar
Tinuviel
 
Posts: 2
Joined: Thu Dec 27, 2018 12:05 pm

Re: 0.96" i2c OLED library screen flip?

Post by Tinuviel »

update:

So Vertigo font is some kind of dirty workaround - for more advanced applications it would be the nightmare to use (you need to output each char separately) but for what I'm doing (display three temperatures) it's fine.

User avatar
wassimk
 
Posts: 8
Joined: Fri Sep 06, 2013 3:02 pm

Re: 0.96" i2c OLED library screen flip?

Post by wassimk »

I know this i an old thread but I ran into the same problem.

I'm using a Adafruit 128x32 PiOLED.

There isn't a setRotation() method that I could find. You can just set it though:

Code: Select all

disp = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c)
disp.rotation = 2

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

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”