tim004 tim004 / Mbed 2 deprecated LV6zad2

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
tim004
Date:
Mon Apr 07 07:42:58 2014 +0000
Commit message:
LV6-PAI-Grupa1-Tim004-Zad2

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 ef5555f028e6 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Apr 07 07:42:58 2014 +0000
@@ -0,0 +1,42 @@
+#include "mbed.h"
+ 
+BusOut prikaz1(dp26,dp25,dp24,dp23);
+BusOut prikaz2(dp28,dp6,dp5,dp27);
+ 
+DigitalOut enable(dp14);
+InterruptIn taster(dp1);
+ 
+int brojac1(0);
+int brojac2(0);
+ 
+bool interrupt=false;
+Timer debounce;
+ 
+void play()
+{
+    if(debounce.read_ms()>200)
+    {
+        brojac2=(brojac2+1)%16;
+        debounce.reset();
+    }
+}
+ 
+Ticker stoper;
+ 
+void count()
+{
+    brojac1=(brojac1+1)%16;
+    prikaz1=brojac1;
+    prikaz2=brojac2;
+}
+ 
+int main()
+{
+    enable=0;
+    prikaz1=brojac1;
+    prikaz2=brojac2;
+    taster.rise(play);
+    debounce.start();
+   stoper.attach(count,0.2);
+   while(1) {}
+}
\ No newline at end of file
diff -r 000000000000 -r ef5555f028e6 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Apr 07 07:42:58 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/7d30d6019079
\ No newline at end of file