04-25-2022, 08:53 AM
[Arduino IDE demo source code for KC868-A6]--#06-OLED_SSD1306_code
6.OLED-1306.zip (Size: 810 bytes / Downloads: 342)
Code:
/*OLED SSD1306 Code for KC868-A6*/
#include <U8g2lib.h>
#include <Wire.h>
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, 15, 4, U8X8_PIN_NONE);//SCL IO15 SDA IO4
void page1() {
u8g2.setFont(u8g2_font_timR18_tf);// Font 18
u8g2.setFontPosTop();
u8g2.setCursor(5,0);
u8g2.print("KINCONY");
u8g2.setFont(u8g2_font_timR12_tf);//Font 12
u8g2.setCursor(0,40);
u8g2.print("www.kincony.com");
}
void setup(){
u8g2.setI2CAddress(0x3C*2);
u8g2.begin();
u8g2.enableUTF8Print();
}
void loop(){
u8g2.firstPage();
do
{
page1();
}while(u8g2.nextPage());
}
6.OLED-1306.zip (Size: 810 bytes / Downloads: 342)