The program uses the BusOut Class to make a counter

Dependencies:   mbed

Fork of BusOut_HelloWorld by mbed_example

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 
00002 /***********************************************
00003 *file name :number show
00004 *creator: Jacob Shi
00005 *Time :2014/10/16
00006 *Description: The program use the BusOut Class to 
00007 *realize a counter(0-9)
00008  *************************************************/
00009 #include "mbed.h"
00010 char data[10]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90};
00011 BusOut port(p21, p22, p23, p24,p25,p26,p27,p28);
00012 
00013 int main() {
00014     while(1) {
00015         for(int i=0; i<10; i++) {
00016             port = data[i];
00017             wait(1);
00018         }
00019     }
00020 }