中野班 中野班
/
LCD課題5
Revision 0:33b5057ddf97, committed 2016-10-07
- Comitter:
- nakano_han
- Date:
- Fri Oct 07 02:05:57 2016 +0000
- Commit message:
- LCD???5?@????????sw???
Changed in this revision
diff -r 000000000000 -r 33b5057ddf97 TextLCD.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TextLCD.lib Fri Oct 07 02:05:57 2016 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/simon/code/TextLCD/#308d188a2d3a
diff -r 000000000000 -r 33b5057ddf97 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Oct 07 02:05:57 2016 +0000 @@ -0,0 +1,33 @@ +#include "mbed.h" +#include "TextLCD.h" + +TextLCD lcd(D8,D10,D11,D12,D13,D14); // rs, e, d4, d5, d6, d7) //LCD出力設定 +AnalogIn sw1(A4); //SW入力設定 + +int main() +{ + int a = 0; //関数aを定義 + int y = 0; //関数yを定義 + + while(1) //無限ループ + { + if(sw1 == 1) //swが押されたら{}内実行 + { + a++; //aに1足す + wait(0.25); //0.25秒待つ + } + lcd.locate(a,y); //表示座標 + lcd.puts("@"); //文字表示 + + if(a >= 16) //aが16より大きくなったら{}内実行 + { //LCDの横が最大16なので画面外に出ないように + y++; //yに1足す + a = 0; //aを初期化 + if(y >= 2) //yが2以上になったとき{}内実行 + { + y = 0; //yを初期化 + lcd.cls(); //LCD表示初期化 + } + } + } +}
diff -r 000000000000 -r 33b5057ddf97 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Oct 07 02:05:57 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/25aea2a3f4e3 \ No newline at end of file