Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 4:0f29c512e03d
- Parent:
- 3:d4b979f6f27e
diff -r d4b979f6f27e -r 0f29c512e03d main.cpp
--- a/main.cpp Sat Jun 08 15:25:18 2019 +0000
+++ b/main.cpp Sat Jun 22 11:44:01 2019 +0000
@@ -9,33 +9,39 @@
// TextLCDの使用宣言
TextLCD lcd(p15,p16,p17,p18,p19,p20); //接続ポートの設定(rs,e,d4,d5,d6,d7)
-
int main()
{
-
- lcd.init(); //各種設定を初期値に。画面も消去。カーソル位置(0,0)
+ //各種設定を初期値に。画面も消去。カーソル位置(0,0)
+ lcd.init();
// 単純な文字列表示
- lcd.printf("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ lcd.printf("RoBoCon 2019!");
wait(1);
// カーソル位置を(0,1)に指定
lcd.locate(0,1);
- lcd.printf("abcdefghijklmnopqrstuvwxyz");
-
+ lcd.printf("Run Run Laundry");
+ wait(5);
//表示内容はそのままで、カーソル位置を0,0に。画面のシフトも初期位置に
lcd.home();
- wait(1);
+ wait(0.5);
lcd.noDisplay(); //ディスプレイ表示OFF
- lcd.printf("0123");//表示OFFのままprint
- wait(1);
+ wait(0.5);
+
+ lcd.display(); //ディスプレイ表示ON
+
+ wait(0.5);
- lcd.display(); //ディスプレイ表示ON(画面OFFのままprintしても反映されている)
+ lcd.noDisplay(); //ディスプレイ表示OFF
- wait(1);
+ wait(0.5);
+
+ lcd.display(); //ディスプレイ表示ON
+
+ wait(0.5);
lcd.cursor(); //カーソル表示ON
@@ -134,14 +140,34 @@
for (int j=0; j<8; j++) {
lcd.putc(j);
}
+ wait(5);
+ lcd.locate(0,0);
+
+ lcd.set_max_cols(16);
+ lcd.kana_print("カタカナ モ ヒョウジデキル");
+
+ lcd.kana_print("サシスセソ");
+ lcd.kana_print("タチツテト");
+ lcd.kana_print("ナニヌネノ");
+/* for (int i = 0; i < 15;i++) {
+ lcd.printf("%x",s[i]);
+ }
+ */
while(1) {
- myled = 1;
- wait(LED_TIME);
- myled = 0;
- wait(LED_TIME);
+
+
+ lcd.set_max_cols(16);
+ lcd.cls();
+
+ for (int x = 0;x < 99 ;x++) {
+ lcd.locate(0,0);
+ lcd.printf("count = %02d\n",x);
+ wait(0.5);
+ }
+
}
}