Example program using the mbed 23 LEDs prototype shield. The shield has 23 LEDs attached to D0-D15, A0-A5, plus one for power indication.
Dependencies: mbed
main.cpp@0:ccfe324ca25b, 2014-04-11 (annotated)
- Committer:
- screamer
- Date:
- Fri Apr 11 10:16:51 2014 +0000
- Revision:
- 0:ccfe324ca25b
- Child:
- 1:5863255898a3
Initial revision using BusOut API
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
screamer | 0:ccfe324ca25b | 1 | #include "mbed.h" |
screamer | 0:ccfe324ca25b | 2 | |
screamer | 0:ccfe324ca25b | 3 | BusOut bus1(D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15); |
screamer | 0:ccfe324ca25b | 4 | BusOut bus2(A5, A4, A3, A2, A1, A0); |
screamer | 0:ccfe324ca25b | 5 | int i; |
screamer | 0:ccfe324ca25b | 6 | |
screamer | 0:ccfe324ca25b | 7 | int main() |
screamer | 0:ccfe324ca25b | 8 | { |
screamer | 0:ccfe324ca25b | 9 | for (i=0; i<65535; i++) { |
screamer | 0:ccfe324ca25b | 10 | bus1 = i; |
screamer | 0:ccfe324ca25b | 11 | bus2 = i; |
screamer | 0:ccfe324ca25b | 12 | wait(0.001); |
screamer | 0:ccfe324ca25b | 13 | } |
screamer | 0:ccfe324ca25b | 14 | } |