by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
main.cpp@0:16b794fa12e0, 2013-05-24 (annotated)
- Committer:
- robt
- Date:
- Fri May 24 21:34:30 2013 +0000
- Revision:
- 0:16b794fa12e0
by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
robt | 0:16b794fa12e0 | 1 | /* Program Example 8.6: LCD Counter example |
robt | 0:16b794fa12e0 | 2 | */ |
robt | 0:16b794fa12e0 | 3 | |
robt | 0:16b794fa12e0 | 4 | #include "mbed.h" |
robt | 0:16b794fa12e0 | 5 | #include "TextLCD.h" |
robt | 0:16b794fa12e0 | 6 | TextLCD lcd(p19, p20, p21, p22, p23, p24); // rs, e, d0, d1, d2, d3 |
robt | 0:16b794fa12e0 | 7 | int x=0; |
robt | 0:16b794fa12e0 | 8 | |
robt | 0:16b794fa12e0 | 9 | int main() { |
robt | 0:16b794fa12e0 | 10 | lcd.printf("LCD Counter"); |
robt | 0:16b794fa12e0 | 11 | while (1) { |
robt | 0:16b794fa12e0 | 12 | lcd.locate(5,1); |
robt | 0:16b794fa12e0 | 13 | lcd.printf("%i",x); |
robt | 0:16b794fa12e0 | 14 | wait(0.01); |
robt | 0:16b794fa12e0 | 15 | x++; |
robt | 0:16b794fa12e0 | 16 | } |
robt | 0:16b794fa12e0 | 17 | } |