This DIY project will tell you how to send a string like “Hello World!” to I2C 1602 LCD.
Osoyoo I2C 1602 LiquidCrystal Display is an improved version of the traditional alphanumeric LCD (16×2 characters) in original OSOYOO starter kit for Arduino .
Osoyoo I2C 1602 LCD based on the 1602 panel with a small back-panel to convert it to I2C. The old style 1602 LCD needs 4 data lines + 2 control lines and totally occupies 6 digital ports. The new Osoyoo I2C LCD occupies only two analog ports and saves lots of Arduino port resources.
Setup instructions :
Step 1: Download LiquidCrystal_I2C.zip library file and Install I2C library:
This library REPLACES the standard one in Arduino V1.0. So
– in Arduino root fold->libraries rename the existing LiquidCrystal library directory
– unzip the LiquidCrystal_I2C.zip file
– place the folder LiquidCrystal_I2C into the libraries folder.
– in Arduino IDE click: Sketch->Import Library ->Add Library , then select above LiquidCrystal_I2C fold and open.
the import library list should show a new item “LiquidCrystal_I2C”
– Start up the Arduino IDE
Step 2 – Connect LCD with OSOYOO Basic board
If your OSOYOO Basic board is an Uno, the I2C connections are on SDA=A4 and SCL=A5. So go ahead and wire these up, along with the two power leads to the 5V and GND terminals.
Step 3 – Power up your devices.
You should see the LCD light up. Depending on how the device was constructed, you might want to turn down the contrast of the LCD; you can do this by inserting a screwdriver into the potentiometer at the back. I suggest you turn it half-way so that there’s still a little contrast.
Step 4 – find the I2C address
Each device has an I2C address that it uses to accept commands or send messages. For Uno board, this address usually is 0x27. But sometimes the address might be changed 0x37,0x24 …., So let’s go and look for the one on your device.
Download ic2_scanner sketch file and load it into IDE. By opening up the serial monitor in the upright corner, OSOYOO Basic board will scan the address range looking for a reply. Most OSOYOO Basic board will show 0x27, however it be other number.
Write down the Address that you have found, you’ll need it in the next step.
Step 5 – Fire up the LCD
Download ic2_lcd_test sketch file and set the I2C address to match ic2_scanner output value, load it into Arduino IDE.
You should see following message in LCD:
Hello World!
Soonics.com/blog
Done!
公式ストアは下記のリンクをクリック
DownLoad Url osoyoo.com
You must be logged in to post a comment.
はじめまして。
コンパイルすると下記のようなエラーが出ます。
どうすればよいでしょうか?
C:\Program Files\Arduino\libraries\LiquidCrystal_I2C\ic2_scanner.cpp: In function ‘void setup()’:
C:\Program Files\Arduino\libraries\LiquidCrystal_I2C\ic2_scanner.cpp:10:3: error: ‘Serial’ was not declared in this scope
Serial.begin(9600);
^
C:\Program Files\Arduino\libraries\LiquidCrystal_I2C\ic2_scanner.cpp: In function ‘void loop()’:
C:\Program Files\Arduino\libraries\LiquidCrystal_I2C\ic2_scanner.cpp:17:3: error: ‘byte’ was not declared in this scope
byte error, address;
^
C:\Program Files\Arduino\libraries\LiquidCrystal_I2C\ic2_scanner.cpp:20:3: error: ‘Serial’ was not declared in this scope
Serial.println(“Scanning…”);
^
C:\Program Files\Arduino\libraries\LiquidCrystal_I2C\ic2_scanner.cpp:23:7: error: ‘address’ was not declared in this scope
for(address = 1; address < 127; address++ )
^
C:\Program Files\Arduino\libraries\LiquidCrystal_I2C\ic2_scanner.cpp:29:5: error: 'error' was not declared in this scope
error = Wire.endTransmission();
^
C:\Program Files\Arduino\libraries\LiquidCrystal_I2C\ic2_scanner.cpp:54:13: error: 'delay' was not declared in this scope
delay(5000); // wait 5 seconds for next scan
^
exit status 1
ボードArduino/Genuino Unoに対するコンパイル時にエラーが発生しました。
はじめまして~
お問い合わせ、ありがとうございます。Amazon日本の担当者jackと申します。
まずは、ArduinoIDEにボードのタイプとCOMポートを正しく選択しているかと確認よろしくお願い致します。
次は、「libraries」でのLiquidCrystal_I2Cフォルダをすべて削除してくださいませ。
ご注意:2つの「libraries」フォルダを存在しています:
① C:\Users\Administrator\Documents\Arduino(例、お客様の場合、実際のパスを探してくださいませ。)
② C:\Program Files\Arduino\libraries
下記のリンクでダウンロードしたのLiquidCrystal_I2C.zipファイルを解凍して、上記の2つのフォルダにコーピーしてくださいませ。
https://osoyoo.com/wp-content/uploads/samplecode/LiquidCrystal_I2C.zip
最後に、I2Cのアドレスを正しいかと確認してくださいませ。
また、何か質問がございましたら、メールよろしくお願い致します。メールの場合、早めに返信できると思います。
メールアドレス [email protected]
どうぞよろしくお願い致します。