HOW to Display Messages on 1602 LCD with Microbit
Overview
In life, we can use the display and other sensors to do a variety of experiments. You can DIY a variety of small items. For example, use a temperature module and display to make a temperature tester, or use an ultrasound module and display to make a distance tester.
In the following, we will use keyestudio 1602 I2C module as the display, connect it to I2C pin headers of micro:bit shield. You will learn how to control the 1602 LCD show the character“keyestudio”and number.
Components Required
-
Micro:bit main board*1
-
Keyestudio Micro bit Sensor V2 Shield*1
-
USB Cable*1
-
keyestudio 1602 LCD I2C Module*1
-
DuPont jumper wire*3
-
Premium Battery Holder 6-cell AA*1
-
1.5V AA Battery*6
Component Introduction
keyestudio 1602 I2C Module:
This module is a LCD 16x2 display, useful for creating standalone projects.
Connection Diagram
Test Code
Set test code with library file
Add the library file in the following block
Library file link:https://github.com/xuefengedu/pxt-lcd1602_CN
The file is downloaded automatically, then you could check the corresponding block in the edit code column
Test Results
Wire up according to connection diagram. plug in external power and upload code to micro:bit,the character “Keyestudio” is displayed on the first line, and the number is displayed on the second line. The number increases by 1 every second.