Tulisan Jepang Oled SSD1306 I2C Pakai Library u8g2

Posted on

Kode Program

/*
  Copyright (c) 2016, olikraus@gmail.com
  All rights reserved.
*/

#include <Arduino.h>
#include <U8g2lib.h>
#include <Wire.h>

U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, /* reset=*/U8X8_PIN_NONE);

void setup(void) {
  u8g2.begin();
  u8g2.enableUTF8Print();  // enable UTF8 support for the Arduino print() function
}

void loop(void) {

  u8g2.firstPage();
  do {
    // all the glyphs of "こんにちは世界" are already included in japanese1: Lerning Level 1-6
    u8g2.setFont(u8g2_font_b10_t_japanese1);
    u8g2.setFontDirection(0);
    u8g2.setCursor(0, 15);

    // Japanese "Hello World"
    u8g2.print("こんにちは世界");
  } while (u8g2.nextPage());
  delay(1000);
}

Hasil

Bahasa Jepang Oled SSD1306 I2C Pakai Library u8g2