Difference between revisions of "SDD1306 OLED Display"

From Land Boards Wiki
Jump to navigation Jump to search
Line 3: Line 3:
 
[[File:Si5351_003_720px.jpg]]
 
[[File:Si5351_003_720px.jpg]]
  
 +
** 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]
  

Revision as of 13:22, 30 October 2020

128x32 OLED

Si5351 003 720px.jpg

    • I2C Interface
    • OLED runs from 3.3V (can run from 5V but this use has 3.3V)
  • Ebay

OLED128x32.PNG

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);  
}