Get started with Grove - 4 Digit Display
Dependencies: DigitDisplay mbed
main.cpp@0:89330707469d, 2014-04-28 (annotated)
- Committer:
- yihui
- Date:
- Mon Apr 28 00:59:56 2014 +0000
- Revision:
- 0:89330707469d
initial
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yihui | 0:89330707469d | 1 | #include "mbed.h" |
yihui | 0:89330707469d | 2 | #include "DigitDisplay.h" |
yihui | 0:89330707469d | 3 | |
yihui | 0:89330707469d | 4 | DigitDisplay display(P1_14, P1_13); // 4-Digit Display connected to UART Grove connector |
yihui | 0:89330707469d | 5 | DigitalOut led(LED1); |
yihui | 0:89330707469d | 6 | |
yihui | 0:89330707469d | 7 | int main() { |
yihui | 0:89330707469d | 8 | int count = 0; |
yihui | 0:89330707469d | 9 | while(1) { |
yihui | 0:89330707469d | 10 | display = count; |
yihui | 0:89330707469d | 11 | count++; |
yihui | 0:89330707469d | 12 | led = !led; |
yihui | 0:89330707469d | 13 | wait(1); |
yihui | 0:89330707469d | 14 | } |
yihui | 0:89330707469d | 15 | } |