FET10 Bargraph blinker

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
wango
Date:
Sat Mar 10 11:33:21 2012 +0000
Commit message:
FET10 Bargraph blinker

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r d574ad813fe4 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Mar 10 11:33:21 2012 +0000
@@ -0,0 +1,74 @@
+#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();
+   }
+   }
+   }
+}
diff -r 000000000000 -r d574ad813fe4 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Mar 10 11:33:21 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4c0c40fd0593