use the PortOut Class to make a timetick
Dependencies: mbed
Fork of PortOut_HelloWorld by
main.cpp
- Committer:
- shiyilei
- Date:
- 2014-10-17
- Revision:
- 2:fb1498b28a57
- Parent:
- 0:9bbfdb1487ff
File content as of revision 2:fb1498b28a57:
/************************************************* *file:time counter *creator:JacobShi *Time:2014/10/16 * Description: This is a time downcounter from 9-0 **************************************************/ #include "mbed.h" char lednumber[10]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90}; PortOut portled(Port0,0x000000ff);/*p0_0~p0_7*/ int i=0; int main() { while(1) { portled=lednumber[i]; i=(i++)%10; wait(1); } }