LCD Screen
Your "Text Display"
Displaying Text and Information
What it is
The LCD Screen category contains blocks for configuring and controlling an I2C character LCD.
The confirmed Clu-Blocks Pro generation uses:
Python
import machine
import i2clcd
and creates the LCD through an I2C connection.
The category allows students to:
- Configure the I2C connection.
- Initialize the LCD.
- Display text.
- Select column and line positions.
- Center or not center text.
- Display text using a delay value.
- Turn the LCD backlight ON or OFF.
- Clear the screen.
Think of the LCD as a small text screen for showing messages, sensor readings, counters, states, and other information produced by the program.
Fun Guide to LCD Display Blocks (Clu-blocks Pro)
What it is: Blocks for displaying text on character displays.
What it does: Displays messages on character displays.
Example: Displaying "Hello" on a 16x2 display.
It's the robot's lighted sign.
Important! LCD blocks let your robot talk visually showing messages, sensor data, or even animations. It’s like giving your robot a mini billboard!
The category can be organized into four conceptual families:
SETUP → DISPLAY → BACKLIGHT → CLEAR
Setup & Configuration
| Block | What it does | Dropdown options | What the options mean |
| Sets up I2C communication and Initializes the LCD screen | — | Needed before using the LCD SCL/SDA are data pins | |
| Initializes the LCD screen | — | LCD1602 is a 2-line, 16-character display 0x27 is the common I2C address |
Displaying Text
| Block | What it does | Dropdown options | What the options mean |
| Shows text on the screen | — | You choose the position and alignment great for titles or labels | |
| Prints text witd animation | — | Shows characters one by one perfect for typing effects or suspense |
Backlight & Control
| Block | What it does | Dropdown options | What the options mean |
| Turns the screen backlight on or off | on display, off display | Controls brightness useful for saving power or signaling status | |
| Clears everytding from the screen | — | Use tdis before updating the screen or switching messages |
Quick Tips for Students
- Use setup blocks first your LCD won’t work witdout I2C setup and address.
- Use rows and columns to position text row 0 is top, row 1 is bottom.
- Use middle alignment for titles it looks clean and professional.
- Use print witd interval for cool effects like typing or countdowns.
- Use clear + backlight to refresh or hide the screen great for transitions or alerts.
1. Setting Up I2C
[ INSERT BLOCK IMAGE HERE: I2C Setup ]
Before using the LCD, Clu-Blocks Pro configures an I2C connection.
The supplied generation is:
Python
i2c_extend = machine.SoftI2C(
scl = machine.Pin(26),
sda = machine.Pin(25),
freq = 100000
)
The setup therefore contains three important values:
| Setting | Example | Main Idea |
|---|---|---|
| SCL | 26 | I2C clock connection |
| SDA | 25 | I2C data connection |
| Frequency | 100000 | I2C communication frequency |
The resulting I2C connection is represented by:
Python
i2c_extend
Conceptually:
D1 R32 ↔ SCL + SDA ↔ LCD
Configure I2C first, then configure the LCD.
2. Setting Up the LCD
[ INSERT BLOCK IMAGE HERE: LCD Setup ]
Once I2C is configured, Clu-Blocks Pro creates the LCD:
Python
lcd = i2clcd.LCD(
i2c_extend,
lcd_width=16,
i2c_addr=0x27
)
The confirmed example contains:
I2C Connection
Plain Text
i2c_extend
LCD Width
Plain Text
16
I2C Address
Plain Text
0x27
The configured display is then represented by:
Python
lcd
All following LCD operations act on this object.
The setup progression is:
I2C Setup → LCD Setup → Display Information
3. The I2C Address
The confirmed example uses:
Plain Text
0x27
The 0x prefix indicates that the address is written in hexadecimal notation.
Students have already seen hexadecimal notation in other areas of Clu-Blocks Pro, particularly IR.
However, the concepts should remain separate:
IR Hex Command → command information
LCD 0x27 → I2C address
The LCD address identifies the device for the I2C operation.
4. Displaying Text
[ INSERT BLOCK IMAGE HERE: LCD Shows ]
The basic display operation uses:
Python
lcd.shows(...)
The supplied example is:
Python
lcd.shows(
"Clu-Bots",
column = 0,
line = 0,
center = True
)
The block therefore supplies four important pieces of information:
- Text
- Column
- Line
- Center setting
Conceptually:
TEXT + POSITION + ALIGNMENT → LCD
5. Text
The example displays:
Plain Text
Clu-Bots
This is the information that appears through the LCD display operation.
The text does not need to remain fixed.
Later, students can combine the LCD with:
- Variables
- Sensors
- Math
- Text
Conceptually:
Sensor → Value → Text → LCD
6. Column
The example uses:
Python
column = 0
This parameter specifies the column value passed to the LCD operation.
For students, column can be understood as the horizontal text position.
Conceptually:
COLUMN → LEFT / RIGHT POSITION
7. Line
The example uses:
Python
line = 0
This parameter specifies the line value passed to the display operation.
For students:
LINE → WHICH DISPLAY LINE
This allows information to be placed in different text areas on the display.
Conceptually:
COLUMN + LINE → TEXT POSITION
8. Centering Text
One of the important improvements in this regeneration is that we now know both real alignment options.
When centering is enabled, Clu-Blocks Pro generates:
Python
lcd.shows(
"Clu-Bots",
column = 0,
line = 0,
center = True
)
When centering is disabled:
Python
lcd.shows(
"Clu-Bots",
column = 0,
line = 0,
center = False
)
Therefore:
| Block Selection | Generated Value |
|---|---|
| Center ON | center=True |
| Center OFF | center=False |
The important concept is:
Centered Text → True
Normal Positioning → False
9. Position vs. Center
Students should understand that the display operation provides both:
column / line
and:
center
These should not be treated as isolated LCD features.
The fundamental display question is:
WHAT?
Text
WHERE?
Column + Line
HOW?
Centered or not centered
So:
WHAT → WHERE → ALIGNMENT
This is an easy mental model for beginners.
10. LCD Print with Delay
[ INSERT BLOCK IMAGE HERE: LCD Print ]
The category also provides another text-display operation.
The real Clu-Blocks Pro generation confirms:
Python
lcd.print(
"Clu-Bots",
column = 0,
line = 0,
delay = 5
)
This operation uses:
- Text
- Column
- Line
- Delay
The confirmed example uses:
Plain Text
delay = 5
The important difference in actual generation is:
Show Text
Python
lcd.shows(...)
Print with Delay
Python
lcd.print(..., delay=5)
For the technical documentation, these should remain two distinct LCD operations.
11. Understanding delay
The final argument of the LCD print() operation is generated as:
Python
delay=5
Therefore, the technically accurate explanation is:
The visible delay field supplies the
delayparameter of Clu-Blocks Pro'slcd.print()operation.
We should not give the parameter a more specific timing unit unless that unit is explicitly confirmed by the block interface or library reference.
This follows the same conservative documentation standard we have used throughout the regenerated categories.
12. shows() vs. print()
Students will see two different text operations.
| Operation | Confirmed Generation | Main Difference in Supplied Code |
|---|---|---|
| Shows | lcd.shows(...) | Uses the center parameter. |
lcd.print(...) | Uses the delay parameter. |
For beginners, this can be simplified to:
SHOWS
Display text with positioning/alignment options.
Display text with positioning and the supplied delay option.
There is no need to explain internal library implementation beyond what the real generator confirms.
13. Turning the Backlight ON
[ INSERT BLOCK IMAGE HERE: LCD Backlight ]
The actual generation confirms:
Python
lcd.backlight(1)
Therefore:
Plain Text
1
is the generated value for the confirmed ON state.
Conceptually:
Backlight ON → 1
14. Turning the Backlight OFF
The same block can generate:
Python
lcd.backlight(0)
Therefore:
Plain Text
0
is the generated value for the confirmed OFF state.
The complete relationship is:
| Backlight State | Generated Operation |
|---|---|
| ON | lcd.backlight(1) |
| OFF | lcd.backlight(0) |
This hidden OFF option is now explicitly confirmed by the real MicroPython generation.
15. Clearing the LCD
[ INSERT BLOCK IMAGE HERE: LCD Clear ]
The Clear block generates:
Python
lcd.clear()
Conceptually:
CURRENT TEXT
↓
CLEAR
↓
EMPTY DISPLAY
This is useful before presenting new information when the previous content should no longer remain on the LCD.
16. The Complete LCD Sequence
Students do not need to think of these as isolated blocks.
The category follows a logical workflow:
STEP 1
Configure I2C
↓
STEP 2
Configure LCD
↓
STEP 3
Display Text
↓
STEP 4
Change / Update Information
↓
STEP 5
Clear when needed
The central pattern is:
SETUP → DISPLAY → UPDATE → CLEAR
17. LCD vs. OLED
Students use both display types in Clu-Blocks Pro, so distinguishing the two is important.
LCD
The regenerated category focuses mainly on:
- Strings
- Columns
- Lines
- Centering
- Backlight
- Clear
OLED
The OLED category additionally exposes operations for:
- X/Y coordinates
- Images
- Pixels
- Lines
- Rectangles
- Graphical movement
So the beginner distinction is:
LCD → TEXT-FOCUSED DISPLAY
OLED → GRAPHICAL DISPLAY
Both use I2C in the supplied Clu-Blocks Pro examples, but their available blocks are different.
18. LCD + Sensors
The LCD becomes much more useful when students display real information.
For example:
DHT11
↓
Temperature
↓
Text
↓
LCD
Students can eventually produce information conceptually such as:
Plain Text
Temp: 23
while another line can display:
Plain Text
Humidity: 55
The exact displayed values come from the sensor at runtime.
This provides an important transition from:
STATIC TEXT
to:
LIVE INFORMATION
19. LCD + Text
The Text category becomes particularly useful when sensor measurements need labels.
Conceptually:
"Temperature: "
Converted Sensor Value
↓
Readable Message
↓
LCD
This lets students understand the difference between displaying:
Plain Text
23
and displaying meaningful information such as:
Plain Text
Temperature: 23
20. LCD + Variables
A variable can store information before the information is displayed.
Conceptually:
Sensor
↓
Variable
↓
LCD
For example:
Temperature Sensor → temperature variable → LCD
This becomes helpful as projects grow and the same value is used in several parts of the program.
21. LCD + Serial Port
For your course, I recommend that students continue reporting information to the PC even when the LCD is introduced.
For example:
Sensor Value
↙ ↘
LCD Serial Port
↓
PC
This allows students to verify that:
- The program receives the expected data.
- The PC receives the data.
- The LCD displays the intended information.
It also reinforces an important concept:
LCD → Local output
Serial → PC communication
Quick Guide for Students
Am I using the LCD for the first time?
Start with:
I2C Setup → LCD Setup
Do I want to show text?
Use:
Python
lcd.shows(...)
Do I need to choose where the text appears?
Use:
Column + Line
Do I want centered text?
Use the option generating:
Python
center=True
Do I want normal non-centered positioning?
Use:
Python
center=False
Do I need the LCD print operation with a delay value?
Use:
Python
lcd.print(..., delay=...)
Do I need the backlight ON?
Use the state generating:
Python
lcd.backlight(1)
Do I need the backlight OFF?
Use:
Python
lcd.backlight(0)
Do I want to erase existing display content?
Use:
Python
lcd.clear()
Quick Reference
| Family | Confirmed Generation | Main Idea |
|---|---|---|
| I2C Setup | machine.SoftI2C(...) | Configure LCD communication. |
| LCD Setup | i2clcd.LCD(...) | Create the LCD object. |
| Show Text | lcd.shows(...) | Display text. |
| Column | column=... | Set horizontal text position. |
| Line | line=... | Set display line. |
| Center ON | center=True | Enable centering. |
| Center OFF | center=False | Disable centering. |
| Print with Delay | lcd.print(...,delay=...) | Use the LCD print operation with the supplied delay. |
| Backlight ON | lcd.backlight(1) | Turn the backlight ON. |
| Backlight OFF | lcd.backlight(0) | Turn the backlight OFF. |
| Clear | lcd.clear() | Clear the display. |
