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
00001 #include "mbed.h" 00002 #include "TextLCD.h" 00003 00004 TextLCD lcd(D8,D10,D11,D12,D13,D14); // rs, e, d4, d5, d6, d7) //LCD出力設定 00005 AnalogIn sw1(A4); //SW入力設定 00006 00007 int main() 00008 { 00009 int a = 0; //関数aを定義 00010 int y = 0; //関数yを定義 00011 00012 while(1) //無限ループ 00013 { 00014 if(sw1 == 1) //swが押されたら{}内実行 00015 { 00016 a++; //aに1足す 00017 wait(0.25); //0.25秒待つ 00018 } 00019 lcd.locate(a,y); //表示座標 00020 lcd.puts("@"); //文字表示 00021 00022 if(a >= 16) //aが16より大きくなったら{}内実行 00023 { //LCDの横が最大16なので画面外に出ないように 00024 y++; //yに1足す 00025 a = 0; //aを初期化 00026 if(y >= 2) //yが2以上になったとき{}内実行 00027 { 00028 y = 0; //yを初期化 00029 lcd.cls(); //LCD表示初期化 00030 } 00031 } 00032 } 00033 }
Generated on Sun Jul 17 2022 17:24:47 by
1.7.2