Skip to content

Commit 14494db

Browse files
committed
feat(docs): Add LiquidCrystal_I2C example and CI configuration for I2C LCD control
1 parent 7f30c46 commit 14494db

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

docs/en/api/i2c.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,3 +509,15 @@ Here is an example of how to use the I2C in Slave Mode.
509509
:language: arduino
510510

511511
.. _Arduino Wire Library: https://www.arduino.cc/en/reference/wire
512+
513+
514+
External libraries - examples
515+
*****************************
516+
517+
518+
LiquidCrystal_I2C
519+
^^^^^^^^^^^^^^^^^
520+
521+
This example demonstrates how to use the `LiquidCrystal_I2C`_ library to control an LCD display via I2C.
522+
523+
.. wokwi-example:: libraries/Wire/examples/LiquidCrystal_I2C
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <LiquidCrystal_I2C.h>
2+
3+
LiquidCrystal_I2C lcd(0x27, 16, 2); // I2C address 0x27, 16 column and 2 rows
4+
5+
void setup() {
6+
lcd.init();
7+
lcd.backlight();
8+
}
9+
10+
int counter = 0;
11+
void loop() {
12+
lcd.clear();
13+
lcd.setCursor(6, 0);
14+
lcd.print("ESP32");
15+
lcd.setCursor(0, 1);
16+
lcd.print("Show number:" + String(counter));
17+
counter++;
18+
delay(2000);
19+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
libs:
2+
3+
4+
upload-binary:
5+
targets:
6+
- esp32
7+
diagram:
8+
esp32:
9+
parts:
10+
- type: wokwi-lcd1602
11+
id: lcd1
12+
top: 25.6
13+
left: 168.8
14+
attrs:
15+
pins: i2c
16+
connections:
17+
- - lcd1:GND
18+
- esp:GND.2
19+
- black
20+
- - h-19.2
21+
- v-96
22+
- - lcd1:VCC
23+
- esp:5V
24+
- red
25+
- - h-28.8
26+
- v153.7
27+
- h-139.39
28+
- - lcd1:SDA
29+
- esp:21
30+
- green
31+
- - h-38.4
32+
- v19.4
33+
- - lcd1:SCL
34+
- esp:22
35+
- green
36+
- - h-48
37+
- v-9.3

0 commit comments

Comments
 (0)