I2C LCD SPLC792A

Dependencies:   SPLC792I2C mbed

Files at this revision

API Documentation at this revision

Comitter:
Yajirushi
Date:
Sat Mar 18 01:42:43 2017 +0000
Commit message:
first commit

Changed in this revision

SPLC792I2C.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SPLC792I2C.lib	Sat Mar 18 01:42:43 2017 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/Yajirushi/code/SPLC792I2C/#070d3d0b6f37
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Mar 18 01:42:43 2017 +0000
@@ -0,0 +1,49 @@
+#include "mbed.h"
+#include "SPLC792A_I2C.h"
+
+DigitalOut myled(LED1);                 //動作確認用LED
+DigitalOut rst(D7);                     //rstはVDDに接続してHIGH状態を保てれば良い
+LCDI2C_SPLC792A lcd(I2C_SDA, I2C_SCL);  //LCDI2C_SPLC792Aをlcdという名前でインスタンス化
+
+int main(){
+    //動作遅延用
+    wait(10);
+    rst = 1;
+    wait_us(200);
+
+    //lcd初期化
+    rst = 0;
+    wait_us(200);
+    rst = 1;
+    wait_us(200);
+    lcd.init();
+
+    //動作確認用LED点灯
+    myled = 1;
+
+    lcd.setContrast(4, 40);                 //液晶の表示濃度を設定
+    lcd.cls();                              //液晶表示クリア
+    lcd.writeString("aitendo \\375 LCD");   //aitendoの宣伝
+    lcd.setCursorfromColRow(1, 2);          //2行目の1桁目に移動
+
+    //表示(writeString, print, write, o はすべて同じ関数のエイリアス)
+    lcd.print("mbed");                      //mbedと表示
+    lcd.write(" SPLC");                     // SPLCと表示
+    lcd.o("792A");                          //792Aと表示
+
+    //意味もなく5秒待つ
+    wait(5);
+
+    //画面クリア、 座標を1, 1に
+    lcd.cls();
+    lcd.setCursor(1, 1);
+
+    //表示用文字列宣言
+    char str[] = "Institute of Electrical and Electronics Engineers = IEEE ";
+
+    //宣言した文字を1文字あたり500msで出力する(空白は2倍の1000ms)
+    lcd.print(str, 500);
+
+    //動作確認用LED消灯
+    myled = 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Mar 18 01:42:43 2017 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/mbed_official/code/mbed/builds/093f2bd7b9eb
\ No newline at end of file