Hari Prasad
/
7segment
qwe
Diff: main.cpp
- Revision:
- 0:9786c1febbee
diff -r 000000000000 -r 9786c1febbee main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Jul 16 08:57:34 2015 +0000 @@ -0,0 +1,86 @@ +#include "mbed.h" + +DigitalOut a(p8); +DigitalOut b(p12); +DigitalOut c(p11); +DigitalOut d(p5); +DigitalOut e(p6); +DigitalOut f(p7); +DigitalOut g(p9); +DigitalOut h(p10); +DigitalOut w(LED1); +DigitalOut x(LED2); +DigitalOut y(LED3); +DigitalOut z(LED4); + +int main() +{ + while (1) + { + a=b=c=d=e=f=h=0; //0 + g=1; + wait(0.5); + a=g=d=e=f=h=1; //1 + b=c=0; + wait(0.5); + a=b=g=d=e=h=0; //2 + c=f=1; + wait(0.5); + a=b=c=d=g=h=0; //3 + f=e=1; + wait(0.5); + b=c=f=g=h=0; //4 + a=d=e=1; + wait(0.5); + a=g=c=d=f=h=0; //5 + b=e=1; + wait(0.5); + c=d=e=f=g=h=0; //6 + a=b=1; + wait(0.5); + a=b=c=h=0; //7 + d=e=f=g=1; + wait(0.5); + a=b=c=d=e=f=h=0; //8 + g=0; + wait(0.5); + a=b=c=d=g=f=h=0; //9 + e=1; + wait(0.5); + a=b=c=d=e=f=g=h=1; + wait(1); + w=x=y=z=1; + wait(0.5); + w=x=y=z=0; + wait(0.5); + a=b=c=d=g=f=h=0; //9 + e=1; + wait(0.5); + a=b=c=d=e=f=g=h=0; //8 + wait(0.5); + a=b=c=h=0; //7 + d=e=f=g=1; + wait(0.5); + c=d=e=f=g=h=0; //6 + a=b=1; + wait(0.5); + a=g=c=d=f=h=0; //5 + b=e=1; + wait(0.5); + b=c=f=g=h=0; //4 + a=d=e=1; + wait(0.5); + a=b=c=d=g=h=0; //3 + f=e=1; + wait(0.5); + a=b=g=d=e=h=0; //2 + c=f=1; + wait(0.5); + a=g=d=e=f=h=1; //1 + b=c=0; + wait(0.5); + a=b=c=d=e=f=h=0; //0 + g=1; + wait(0.5); + } +}