The program uses the BusOut Class to make a counter
Dependencies: mbed
Fork of BusOut_HelloWorld by
main.cpp@4:c01479bfd551, 2014-10-16 (annotated)
- Committer:
- shiyilei
- Date:
- Thu Oct 16 07:47:01 2014 +0000
- Revision:
- 4:c01479bfd551
- Parent:
- 3:b83cb0af21b0
The program uses the BusOut Class to make a counter
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shiyilei | 4:c01479bfd551 | 1 | |
shiyilei | 4:c01479bfd551 | 2 | /*********************************************** |
shiyilei | 4:c01479bfd551 | 3 | *file name :number show |
shiyilei | 4:c01479bfd551 | 4 | *creator: Jacob Shi |
shiyilei | 4:c01479bfd551 | 5 | *Time :2014/10/16 |
shiyilei | 4:c01479bfd551 | 6 | *Description: The program use the BusOut Class to |
shiyilei | 4:c01479bfd551 | 7 | *realize a counter(0-9) |
shiyilei | 4:c01479bfd551 | 8 | *************************************************/ |
mbed_official | 0:717993c337df | 9 | #include "mbed.h" |
shiyilei | 2:76f66b714f20 | 10 | char data[10]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90}; |
shiyilei | 4:c01479bfd551 | 11 | BusOut port(p21, p22, p23, p24,p25,p26,p27,p28); |
shiyilei | 2:76f66b714f20 | 12 | |
shiyilei | 4:c01479bfd551 | 13 | int main() { |
shiyilei | 4:c01479bfd551 | 14 | while(1) { |
shiyilei | 4:c01479bfd551 | 15 | for(int i=0; i<10; i++) { |
shiyilei | 4:c01479bfd551 | 16 | port = data[i]; |
shiyilei | 4:c01479bfd551 | 17 | wait(1); |
mbed_official | 0:717993c337df | 18 | } |
shiyilei | 4:c01479bfd551 | 19 | } |
shiyilei | 4:c01479bfd551 | 20 | } |