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:
- 0:224a2b438db4
- Child:
- 1:5c99971e3ee5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Jun 05 13:34:11 2019 +0000
@@ -0,0 +1,75 @@
+#include "mbed.h"
+#include "TextLCD.h"
+
+#define LED_TIME 0.5
+
+DigitalOut myled(P0_22);
+Serial pc(USBTX, USBRX);
+
+TextLCD lcd(p15,p16,p17,p18,p19,p20); //接続ポートの設定(rs,e,d4,d5,d6,d7)
+
+int main()
+{
+
+ lcd.cls();
+ lcd.locate(0,0);
+ // 01234567890123456
+ //lcd.printf("ABCDEFGHIJKLMNO");
+ lcd.printf("abcd");
+
+ lcd.locate(0,1);
+ lcd.printf("abcdefghijklmnopqrstuvwxyz");
+
+ lcd.home();
+ lcd.printf("AB");
+
+ wait(1);
+ lcd.noDisplay(); //ディスプレイ表示OFF
+
+ lcd.printf("CD");//表示OFFのままprint
+
+ wait(1);
+ lcd.display(); //ディスプレイ表示ON(OFFのままprintしても反映されている)
+
+ wait(1);
+ lcd.cursor(); //カーソル表示ON
+
+ lcd.blink(); //ブリンクON
+
+ wait(5);
+
+ lcd.noBlink(); //ブリンクOFF
+
+ lcd.noCursor(); //カーソル表示OFF
+
+ lcd.scrollDisplayLeft();
+ wait(1);
+ lcd.scrollDisplayLeft();
+ wait(1);
+ lcd.scrollDisplayLeft();
+ wait(1);
+ lcd.scrollDisplayRight();
+ wait(1);
+ lcd.scrollDisplayRight();
+ wait(1);
+ lcd.scrollDisplayRight();
+ wait(1);
+ lcd.cls();
+ lcd.locate(10,0);
+ lcd.printLeftToRight();
+ lcd.printf("01234");
+ wait(1);
+// lcd.locate(10,0);
+// lcd.printRightToLeft();
+// lcd.printf("56789");
+
+
+ while(1) {
+ myled = 1;
+ wait(LED_TIME);
+ myled = 0;
+ wait(LED_TIME);
+ }
+}
+
+