รู้จักสินค้านี้
จอแสดงผล OLED ขนาด 1.3 นิ้ว แบบ I2C สีน้ำเงิน OLED Display I2C Module 1.3 inch(128x64 pixel Blue) Vcc=3.3-5Volt
specification : General
Type OLED Display Module
Interface I2C interface
Resolution 128*64
Angle of view 160 degrees
Display color Blue
Display dimension 1.3inch
Driver IC SH1106
Working voltage 3.3V~5V DC
Working current 25mA Max
Compatible Arduino
Application Smart watch, MP3, thermometer, instruments, DIY projects, etc.
วงจรทดสอบ
Code ทดสอบ
/*
Arduino with Test OLED module white SH1106 driver I2C
High resolution: 12864 pixel
For complete project details, visit:Arduinoshop99
*/
#include "Wire.h"
#include "Adafruit_GFX.h"
#include "Adafruit_SH1106.h"
#include "Fonts/FreeMonoBold9pt7b.h" //include font FreeMonoBold9pt7b.h
Adafruit_SH1106 OLED(-1);
void setup() {
OLED.setFont(FreeMonoBold9pt7b); // Use font from file include
OLED.begin(SH1106_SWITCHCAPVCC,0x3C); // initialize with the I2C addr 0x3C (for the 128x64)
}
void loop(){
OLED.clearDisplay();
OLED.setTextColor(WHITE); //Text is white ,background is black
OLED.setTextSize(1);
OLED.setCursor(0,11);
OLED.println("OLED 128x64");
OLED.drawLine(0, 15, 127,15, WHITE);
OLED.setCursor(0,30);
OLED.println("Arduino....");
OLED.setCursor(15,55);
OLED.println("Shop");
OLED.setTextSize(2);
OLED.setCursor(0,59);
OLED.println(" 99");
OLED.drawLine(0, 63, 127,63, WHITE);
OLED.display(); //
delay(200);
}
หรือแบบที่ 2 ใช้ U8g2 new
ติดตั้ง library ก่อนใช้งาน