0Pricing
Arduino & IoT Academy · レッスン

LiquidCrystal_I2Cライブラリ

ディスプレイを初期化し、アドレスを設定します。

「LiquidCrystal_I2Cライブラリ」はCoddyKit上の無料Arduino & IoT Academyレッスンです。 これはレッスン2/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはArduino & IoT Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Arduino & IoT Academyコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

What the Library Does

The LiquidCrystal_I2C library handles all the low-level I2C chatter for you. You just call simple commands to show text. 📚

Install It Once

Open the Library Manager in the Arduino IDE and search for LiquidCrystal_I2C. Click install and it is ready to use.

Include the Header

At the top of your sketch you add an include line so the compiler can find the library's code.

#include <LiquidCrystal_I2C.h>

Create the Object

You make one lcd object that represents your display. Every command you give will go through this object.

LiquidCrystal_I2C lcd(0x27, 16, 2);

The Address Argument

The first number is the I2C address. If your display stays blank, swap 0x27 for 0x3F, the other common value.

Columns and Rows

The next two numbers tell the library the size: 16 columns and 2 rows. This matches a standard 16x2 panel.

Initialize in setup

Inside setup you call lcd.init() once to wake the display and prepare it to receive text.

void setup() {
  lcd.init();
}

Turn On the Backlight

The screen starts dark until you call lcd.backlight(). This lights it up so the characters are readable.

lcd.backlight();

Print Your First Word

Now lcd.print() sends text to the screen. Whatever you pass appears starting at the top-left corner. 🎉

lcd.print("Hello!");

Clearing the Screen

Call lcd.clear() to wipe everything and move the cursor back to the start before writing fresh text.

lcd.clear();

If It Stays Blank

Blank screen with backlight on usually means the wrong address. Run an I2C scanner sketch to find the real one.

Quick Check

Your sketch compiles but the LCD stays dark even with power. Which call did you likely forget?

Recap

You included LiquidCrystal_I2C, created an lcd object with its address and size, then called init and backlight. Your display is alive. ✅

よくある質問

「LiquidCrystal_I2Cライブラリ」レッスンは無料ですか?

はい。「LiquidCrystal_I2Cライブラリ」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Arduino & IoT Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Arduino & IoT Academyコースには全4レッスンが含まれています。

「LiquidCrystal_I2Cライブラリ」で何を学びますか?

ディスプレイを初期化し、アドレスを設定します。 ブラウザで直接実行するハンズオンコードでArduino & IoT Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Arduino & IoT Academyを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのArduino & IoT Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン2/4です。

「LiquidCrystal_I2Cライブラリ」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このArduino & IoT Academyレッスンでコードを書いて実行できますか?

はい。すべてのArduino & IoT Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. 16x2 LCD(I2Cバックパック)を配線する
  2. LiquidCrystal_I2Cライブラリ
  3. カーソルを配置して表示する
  4. リアルタイムセンサーダッシュボード
← Arduino & IoT Academyに戻る