for helge just for testing
Dependencies: Freetronics_16x2_LCD mbed-rtos mbed
Fork of Freetronics_16x2_LCD by
main.cpp@1:cb23381652eb, 2014-07-25 (annotated)
- Committer:
- screamer
- Date:
- Fri Jul 25 10:52:39 2014 +0000
- Revision:
- 1:cb23381652eb
- Parent:
- 0:4a0b425b71ff
- Child:
- 2:4e0ed7dc6420
Update mbed library to the latest revision
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
screamer | 0:4a0b425b71ff | 1 | #include "mbed.h" |
screamer | 0:4a0b425b71ff | 2 | #include "freetronicsLCDShield.h" |
screamer | 0:4a0b425b71ff | 3 | |
screamer | 0:4a0b425b71ff | 4 | freetronicsLCDShield lcd(D8, D9, D4, D5, D6, D7, D3, A0); |
screamer | 0:4a0b425b71ff | 5 | |
screamer | 0:4a0b425b71ff | 6 | int main() { |
screamer | 0:4a0b425b71ff | 7 | // turn on the back light (it's off by default) |
screamer | 0:4a0b425b71ff | 8 | lcd.setBackLight(true); |
screamer | 0:4a0b425b71ff | 9 | |
screamer | 0:4a0b425b71ff | 10 | // print the first line and wait 3 sec |
screamer | 0:4a0b425b71ff | 11 | lcd.printf("mbed application"); |
screamer | 0:4a0b425b71ff | 12 | wait(3); |
screamer | 0:4a0b425b71ff | 13 | |
screamer | 0:4a0b425b71ff | 14 | // print the counter prefix; the number will be printed in the while loop |
screamer | 0:4a0b425b71ff | 15 | lcd.setCursorPosition(1, 0); |
screamer | 0:4a0b425b71ff | 16 | lcd.printf("counter"); |
screamer | 0:4a0b425b71ff | 17 | |
screamer | 0:4a0b425b71ff | 18 | int i=1; |
screamer | 0:4a0b425b71ff | 19 | while (i++) { |
screamer | 0:4a0b425b71ff | 20 | lcd.setCursorPosition(1, 8); |
screamer | 0:4a0b425b71ff | 21 | lcd.printf("%d", i); |
screamer | 1:cb23381652eb | 22 | wait(0.001); |
screamer | 0:4a0b425b71ff | 23 | } |
screamer | 0:4a0b425b71ff | 24 | } |