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.
Fork of TextLCD by
main.cpp
- Committer:
- zhangyx
- Date:
- 2018-03-19
- Revision:
- 11:c66fd440f283
- Parent:
- 10:b5b2b8035bbf
File content as of revision 11:c66fd440f283:
#include "mbed.h" #include "TextLCD.h" int main() { TextLCD lcd(PC_13, PC_14, PC_15, PA_0, PA_1, PB_4, TextLCD::LCD20x4); // rs, e, d4-d7, model lcd.printf("Hello World!"); wait_ms(1000); //等待1秒 lcd.cls(); //清屏 for(int i=0; i<10000; i+=4){ lcd.locate(0,0); //分别控制起始的列和行,从0开始 lcd.printf("%d", i); wait_ms(1000); //等待1秒 lcd.locate(0,1); lcd.printf("%d", i+1); wait_ms(1000); lcd.locate(0,2); lcd.printf("%d", i+2); wait_ms(1000); lcd.locate(0,3); lcd.printf("%d", i+3); wait_ms(1000); lcd.cls(); //清屏 } while(1); }