The program uses the BusOut Class to make a counter
Dependencies: mbed
Fork of BusOut_HelloWorld by
main.cpp
- Committer:
- shiyilei
- Date:
- 2014-10-16
- Revision:
- 3:b83cb0af21b0
- Parent:
- 2:76f66b714f20
- Child:
- 4:c01479bfd551
File content as of revision 3:b83cb0af21b0:
/************************************************* *file name : switch point *creator:Jacob Shi *Time:2014/10/16 *Description: uses to key to control the counter *************************************************/ #include "mbed.h" char data[10]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90}; char i=0; BusInOut key(p5); BusInOut portnum(p21,p22,p23,p24,p25,p26,p27,p28); int main() { key.input(); portnum.output(); while(1) { portnum=0x00; if(key==0) { wait_ms(10); if(key==0) { while(!key); portnum=data[i]; (i++)%10; } } } }