Hi Seeedstudio,
I using the Grove – OLED Display 1.12” V2.
I want to change the orientation of the text that is printed to display.
I have tried the “SeeedGrayOled.setVerticalMode();” and “SeeedGrayOled.setHorizontalMode();” commands but I do not understand what they do. What do these functions do?
Unfortunately they do not change the text orientation ?
- How do I change the orientation of the text printed to the display? See image below.
[cid:[email protected]]
Best regards,
Oliver
Oliver Staberg
[cid:[email protected]]
Consultant at Automotive Embedded Systems
ALTEN Sweden
M +46 (0) 70-982 01 99
Theres Svenssons gata 15
SE- 417 550 Göteborg
[cid:[email protected]]www.alten.comhttp://www.alten.com/> | www.alten.sehttp://www.alten.se/>
Hi
Oliver
We got the mail and will test it tomorrow.
Thanks
best rgds
Bill
Hi Bill,
Thank you for contacting me. I realized now that the “SeeedGrayOled.setVerticalMode();” and “SeeedGrayOled.setHorizontalMode();” functions only control from what direction the display is updated.
- What I need to know if there is a function for changing the text orientation?
- There is none included in the SeeedOLED-library but it must be a function somewhere on internet that works with the Grove – OLED display V2, but I was not able to find it?
Br
//Oliver
Hi Oliver,
you can use the u8g2 libray, configure the U8G2_R1 .
U8G2_SSD1327_SEEED_96X96_1_HW_I2C u8g2(
U8G2_R1, /* reset=*/ U8X8_PIN_NONE);
Rotation
The software emulated display rotation is the first argument of the constructor.
Rotation/Mirror |
Description |
U8G2_R0 |
No rotation, landscape |
U8G2_R1 |
90 degree clockwise rotation |
U8G2_R2 |
180 degree clockwise rotation |
U8G2_R3 |
270 degree clockwise rotation |
U8G2_MIRROR |
No rotation, landscape, display content is mirrored (v2.6.x) |
#include
#include
#include
/* Constructor */
U8G2_SSD1327_SEEED_96X96_1_HW_I2C u8g2(U8G2_R1, /* reset=*/ U8X8_PIN_NONE);
/* u8g2.begin() is required and will sent the setup/init sequence to the display */
void setup(void) {
u8g2.begin();
}
/* draw something on the display with the `firstPage()`/`nextPage()` loop*/
void loop(void) {
u8g2.firstPage();
do {
u8g2.setFont(u8g2_font_ncenB14_tr);
u8g2.drawStr(0,20,"Hello World!");
} while ( u8g2.nextPage() );
delay(1000);
}
Thanks
best rgds
Bill