
LCD 課題1 @アニメーション
Diff: main.cpp
- Revision:
- 0:3bad19809ca8
- Child:
- 1:f2a8b3608b73
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Aug 19 06:32:41 2016 +0000 @@ -0,0 +1,34 @@ +#include "mbed.h" +#include "TextLCD.h" + +TextLCD lcd(D8,D10,D11,D12,D13,D14); // rs, e, d4, d5, d6, d7) +int main(){ + while(1) + { + lcd.cls(); + int a = 0; + + for(a = 0; a <= 15; a++) + { + lcd.locate(a,0); + lcd.puts("@"); + + wait(0.5); + + + lcd.cls(); + } + + for(a = 15; a >= 0; a--) + { + lcd.locate(a,1); + lcd.puts("@"); + + wait(0.5); + + lcd.cls(); + + + } + } +}