tatiuc embedded
/
LCD_EMBEDDED
lcd
main.cpp@0:348c0df0b54e, 2017-06-20 (annotated)
- Committer:
- mijimy
- Date:
- Tue Jun 20 08:24:59 2017 +0000
- Revision:
- 0:348c0df0b54e
counting;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mijimy | 0:348c0df0b54e | 1 | #include "mbed.h" |
mijimy | 0:348c0df0b54e | 2 | #include "TextLCD.h" // insert lcd library |
mijimy | 0:348c0df0b54e | 3 | |
mijimy | 0:348c0df0b54e | 4 | TextLCD display(D8, D9, D4, D5, D6, D7); // rs, e, d4-d7 // declare lcd |
mijimy | 0:348c0df0b54e | 5 | |
mijimy | 0:348c0df0b54e | 6 | int main() { |
mijimy | 0:348c0df0b54e | 7 | int i; // declare variable i |
mijimy | 0:348c0df0b54e | 8 | |
mijimy | 0:348c0df0b54e | 9 | while(1) { |
mijimy | 0:348c0df0b54e | 10 | for(i=99;i>0;i-=2) |
mijimy | 0:348c0df0b54e | 11 | { display.locate(4,1); // col 1 row 1 |
mijimy | 0:348c0df0b54e | 12 | display.printf("count:%2i",i); |
mijimy | 0:348c0df0b54e | 13 | wait(0.5); |
mijimy | 0:348c0df0b54e | 14 | } |
mijimy | 0:348c0df0b54e | 15 | |
mijimy | 0:348c0df0b54e | 16 | } |
mijimy | 0:348c0df0b54e | 17 | } |