![](/media/cache/profiles/9ddc70b3617c3e65c03fa63c230a1705.50x50_q85.jpg)
FET10 Bargraph blinker
main.cpp
- Committer:
- wango
- Date:
- 2012-03-10
- Revision:
- 0:d574ad813fe4
File content as of revision 0:d574ad813fe4:
#include "mbed.h" DigitalOut bar1(p11); DigitalOut bar2(p12); DigitalOut bar3(p13); DigitalOut bar4(p14); DigitalOut bar5(p15); DigitalOut bar6(p16); DigitalOut bar7(p17); DigitalOut bar8(p18); DigitalOut bar9(p19); DigitalOut bar10(p20); bool b1; bool b2; bool b3; bool b4; bool b5; bool b6; bool b7; bool b8; bool b9; bool b10; bool ein; DigitalIn S1(p10); Timer bar_ein; Timer bar_aus; int main() { while(1) { if(S1==1) { if(bar_ein.read()==0&&bar_aus.read()==0) { bar_ein.start(); bar1=1; bar2=1; bar3=1; bar4=1; bar5=1; bar6=1; bar7=1; bar8=1; bar9=1; bar10=1; } if(bar_ein.read()>=0.2) { bar_aus.start(); bar_ein.stop(); bar_ein.reset(); bar1=0; bar2=0; bar3=0; bar4=0; bar5=0; bar6=0; bar7=0; bar8=0; bar9=0; bar10=0; } if(bar_aus.read()>=0.2) { bar_aus.stop(); bar_aus.reset(); } } } }