Junichi Katsu
/
book_3_1_TextLcd
マイコンと電子工作 No5 P48のプログラムです。
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 #include "TextLCD.h" // ライブラリのヘッダ・ファイルをインクルード 00003 00004 // ライブラリを定義 使用するピンを指定する 00005 TextLCD lcd(p24, p26, p27, p28, p29, p30); // rs, e, d4-d7 00006 00007 int main() { 00008 int count = 0; 00009 00010 lcd.printf("Hello World!¥n"); // 文字列を表示する 00011 lcd.printf("count = "); 00012 00013 while(1) { 00014 lcd.locate(8,1); // 表示位置を指定する 00015 lcd.printf("%04d",count); // countの値を表示する 00016 count++; // countをインクリメント 00017 wait(1.0); // 1秒ウエイト 00018 } 00019 }
Generated on Sat Jul 23 2022 02:54:05 by 1.7.2