Difference between revisions of "SDD1306 OLED Display"
Jump to navigation
Jump to search
Blwikiadmin (talk | contribs) (Created page with "== 128x32 OLED == File:Si5351_003_720px.jpg * [https://www.ebay.com/itm/2pcs-0-91-128x32-IIC-I2C-White-OLED-LCD-Display-DIY-Module-For-Arduino/293688288048?ssPageName=ST...") |
Blwikiadmin (talk | contribs) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
[[File:Si5351_003_720px.jpg]] | [[File:Si5351_003_720px.jpg]] | ||
+ | == Features == | ||
+ | |||
+ | * I2C Interface | ||
+ | * OLED runs from 3.3V (can run from 5V but this use has 3.3V) | ||
* [https://www.ebay.com/itm/2pcs-0-91-128x32-IIC-I2C-White-OLED-LCD-Display-DIY-Module-For-Arduino/293688288048?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649 Ebay] | * [https://www.ebay.com/itm/2pcs-0-91-128x32-IIC-I2C-White-OLED-LCD-Display-DIY-Module-For-Arduino/293688288048?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649 Ebay] | ||
[[File:OLED128x32.PNG]] | [[File:OLED128x32.PNG]] | ||
+ | |||
+ | == Arduino Library for OLED == | ||
+ | |||
+ | * [https://github.com/olikraus/u8g2 U8g2: Library for monochrome displays, version 2] | ||
+ | ** [https://github.com/olikraus/u8g2/wiki/u8g2reference Reference library] | ||
+ | ** Constructor | ||
+ | <pre> | ||
+ | U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // STM32, Ebay OLED | ||
+ | </pre> | ||
+ | * [https://github.com/olikraus/u8g2/wiki/fntlistall List of Fonts] | ||
+ | <pre> | ||
+ | u8g2.setFont(u8g2_font_ncenB14_tr); | ||
+ | </pre> | ||
+ | |||
+ | === Hello World Code === | ||
+ | |||
+ | <pre> | ||
+ | U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // STM32, Ebay OLED | ||
+ | |||
+ | void setup(void) { | ||
+ | u8g2.begin(); | ||
+ | } | ||
+ | |||
+ | void loop(void) { | ||
+ | u8g2.clearBuffer(); // clear the internal memory | ||
+ | u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font | ||
+ | u8g2.drawStr(0,10,"Hello World!"); // write something to the internal memory | ||
+ | u8g2.sendBuffer(); // transfer internal memory to the display | ||
+ | delay(1000); | ||
+ | } | ||
+ | </pre> |
Latest revision as of 13:23, 30 October 2020
128x32 OLED
Features
- I2C Interface
- OLED runs from 3.3V (can run from 5V but this use has 3.3V)
- Ebay
Arduino Library for OLED
U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // STM32, Ebay OLED
u8g2.setFont(u8g2_font_ncenB14_tr);
Hello World Code
U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // STM32, Ebay OLED void setup(void) { u8g2.begin(); } void loop(void) { u8g2.clearBuffer(); // clear the internal memory u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font u8g2.drawStr(0,10,"Hello World!"); // write something to the internal memory u8g2.sendBuffer(); // transfer internal memory to the display delay(1000); }