0.96-inch IIC Monochrome Screen
Module Source
Purchase Link:
https://item.taobao.com/item.htm?spm=a1z10.5-c-s.w4002-23284685151.19.1ffe61919S9gQy&id=40809409804
Baidu Netdisk Download Link:
https://pan.baidu.com/s/1xy2zH8-hs-S8-_AcVtBP_g
Password:0jhj
Specifications
Operating Voltage: 3.3V
Operating Current:9MA
Module Dimensions:27.3 x 27.8 MM
Pixel Resolution:128(H) x 64(V)RGB
Driver Chip:SSD1306
Communication Protocol:IIC
Pin Count:4 Pin (2.54mm pitch header)
Hardware Connection
- VCC: Connect to the development board's 3.3V or 5V (depending on the OLED screen's voltage requirements; most SSD1306 modules support both 3.3V and 5V).
- GND: Connect to the development board's GND.
- SCL: Connect to the development board's A5 or SCL pin.
- SDA: Connect to the development board's A4 or SDA pin.
Usage Method
Installing Library Files (skip this step if already installed)
- Open the Arduino IDE.
- Go to “Tools” > “Manage Libraries…”.
- Search for “Adafruit SSD1306” and “Adafruit GFX”, and install each library individually.
Enter the code:
c
/******************************************************************************
* Test Hardware: LCSC ColorEasyDuino Development Board
* Version Number: V1.0
* Modified By: www.lckfb.com
* Modification Date: March 28, 2024
* Function Overview:
*****************************************************************************
* Open-source development board hardware and software information and related projects hardware and software information on official website
* Development board official website: www.lckfb.com
* Technical support resident forum, any technical problems are welcome at any time to exchange learning
* LCSC Forum: club.szlcsc.com
* Follow our Bilibili account: [立创开发板], stay toned to our latest news!
* We focus on cultivating Chinese engineers rather than profiting from board sales.
******************************************************************************/
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
// Set screen width and height
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
// Create an Adafruit_SSD1306 object. The parameter is the reset pin, which is passed as -1 since many modules do not use it.
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
void setup() {
// Initialize OLED screen
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // The 0x3C here is the I2C address for most OLED screens; if it doesn't work, try 0x3D.
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Infinite Loop
}
display.clearDisplay();
display.setTextSize(1); // Set text size
display.setTextColor(SSD1306_WHITE); // Set text color
display.setCursor(0,0); // Set text starting position
display.println(F("Hello, world!"));
display.setTextSize(2);
display.setCursor(0,10);
display.println(F("SSD1306"));
display.display(); // Display all drawing operations
}
void loop() {
// No code to repeat here
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49