Smart Home Automation Forum
[Arduino source code for KC868-M16 V2]-OLED Show - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20)
+--- Forum: KC868-M16 / M1 / MB / M30 (https://www.kincony.com/forum/forumdisplay.php?fid=50)
+--- Thread: [Arduino source code for KC868-M16 V2]-OLED Show (/showthread.php?tid=3375)



[Arduino source code for KC868-M16 V2]-OLED Show - KinCony Support - 10-10-2023

Code:
/*OLED SSD1306 Code for KC868-M16v2*/

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

U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0,  5, 4, U8X8_PIN_NONE);//SCL IO5  SDA  IO4 
void page1() {

  u8g2.setFont(u8g2_font_timR12_tf);//Font 12
  u8g2.setCursor(0,15);
  u8g2.print("KC868-M16 V2");
}
void setup(){

  u8g2.setI2CAddress(0x3C*2);
  u8g2.begin();
  u8g2.enableUTF8Print();
}
void loop(){

  u8g2.firstPage();
  do
  {
    page1();
  }while(u8g2.nextPage());

}

Install ug82 library