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-05
- Revision:
- 1:5c99971e3ee5
- Parent:
- 0:224a2b438db4
- Child:
- 2:d2d66ce72529
File content as of revision 1:5c99971e3ee5:
#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.leftToRight();
    lcd.printf("01234");
    wait(1);
//    lcd.locate(10,0);
//    lcd.rightToLeft();
//    lcd.printf("56789");
    
    
   while(1) {
        myled = 1;
        wait(LED_TIME);
        myled = 0;
        wait(LED_TIME);
    }
}