Junichi Katsu
/
book_3_1_TextLcd
マイコンと電子工作 No5 P48のプログラムです。
main.cpp
- Committer:
- jksoft
- Date:
- 2011-06-03
- Revision:
- 0:565b34645ba2
File content as of revision 0:565b34645ba2:
#include "mbed.h" #include "TextLCD.h" // ライブラリのヘッダ・ファイルをインクルード // ライブラリを定義 使用するピンを指定する TextLCD lcd(p24, p26, p27, p28, p29, p30); // rs, e, d4-d7 int main() { int count = 0; lcd.printf("Hello World!¥n"); // 文字列を表示する lcd.printf("count = "); while(1) { lcd.locate(8,1); // 表示位置を指定する lcd.printf("%04d",count); // countの値を表示する count++; // countをインクリメント wait(1.0); // 1秒ウエイト } }