The program uses the BusOut Class to make a counter
Dependencies: mbed
Fork of BusOut_HelloWorld by
Diff: main.cpp
- Revision:
- 2:76f66b714f20
- Parent:
- 0:717993c337df
- Child:
- 3:b83cb0af21b0
--- a/main.cpp Sat Sep 20 23:03:03 2014 +0000 +++ b/main.cpp Thu Oct 16 07:39:18 2014 +0000 @@ -1,12 +1,19 @@ +/*********************************************** +*file name :number show +*creator: Jacob Shi +*Time :2014/10/16 +*Description: The program use the BusOut Class to +*realize a counter(0-9) + *************************************************/ #include "mbed.h" - -BusOut myleds(LED1, LED2, LED3, LED4); - +char data[10]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90}; +BusOut port(p21, p22, p23, p24,p25,p26,p27,p28); + int main() { while(1) { - for(int i=0; i<16; i++) { - myleds = i; - wait(0.25); + for(int i=0; i<10; i++) { + port = data[i]; + wait(1); } } } \ No newline at end of file