Description: Two lines of text are displayed on an OLED 64×32 using the u8g2 library with an Arduino Nano.
Installing the Library: In the Arduino IDE under the Tools menu navigate to Manage Libraries and search for U8g2. Proceed to install the U8g2 Library by oliver as shown in the image below.
Supplies:
1 – Breadboard 400 Points
1 – Arduino Nano
1 – OLED Display 0.49″ 64×32 SSD1306 >> Link <<
Arduino Code:
#include <Arduino.h> #include <U8x8lib.h> #ifdef U8X8_HAVE_HW_SPI #include <SPI.h> #endif U8X8_SSD1306_64X32_1F_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE); void setup(void) { u8x8.begin(); u8x8.setPowerSave(0); } void loop(void) { u8x8.setFont(u8x8_font_chroma48medium8_r); u8x8.drawString(0,1,"Tropical"); u8x8.drawString(0,2,"Engineer"); delay(2000); }