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.
main.cpp
- Committer:
- tontoko
- Date:
- 2019-06-08
- Revision:
- 2:d2d66ce72529
- Parent:
- 1:5c99971e3ee5
- Child:
- 3:d4b979f6f27e
File content as of revision 2:d2d66ce72529:
#include "mbed.h"
#include "TextLCD.h"
#define LED_TIME 0.2
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("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
lcd.cursor_on();
lcd.blink_on();
lcd.locate(0,1);
lcd.printf("abcdefghijklmnopqrstuvwxyz");
lcd.home();
wait(1);
lcd.noDisplay(); //ディスプレイ表示OFF
lcd.printf("0123");//表示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.shiftDisplayLeft();
wait(1);
lcd.shiftDisplayLeft();
wait(1);
lcd.shiftDisplayLeft();
wait(1);
lcd.shiftDisplayRight();
wait(1);
lcd.shiftDisplayRight();
wait(1);
lcd.shiftDisplayRight();
wait(1);
lcd.cls();
lcd.locate(10,0);
lcd.leftToRight();
lcd.printf("5678");
wait(1);
lcd.locate(3,0);
lcd.rightToLeft();
lcd.printf("1234567890");
lcd.shiftDisplayRight();
lcd.shiftDisplayRight();
lcd.shiftDisplayRight();
lcd.leftToRight();
lcd.cls();
lcd.home();
wait(1);
lcd.AutoScroll();
lcd.locate(8,0);
lcd.printf("1");
wait(1);
lcd.printf("2");
wait(1);
lcd.printf("3");
wait(1);
lcd.printf("4");
wait(1);
lcd.noAutoScroll();
//lcd.printf("Demo is COMPLETE!");
while(1) {
myled = 1;
wait(LED_TIME);
myled = 0;
wait(LED_TIME);
}
}