Eldar Granulo Faris Odobasic

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
tim003
Date:
Mon Mar 10 11:00:00 2014 +0000
Commit message:
LV2_Pai_grupa2_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 c815fa07c2ef main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Mar 10 11:00:00 2014 +0000
@@ -0,0 +1,58 @@
+#include "mbed.h"
+ BusOut myledsarray(dp23, dp24, dp25, dp26, dp27, dp5, dp6, dp28);
+ 
+DigitalOut enable(dp14);
+DigitalIn taster1(dp1);
+DigitalIn taster2(dp2);
+ 
+void enlarge()
+{
+    int counter = 0;
+    for(int i = 0; i < 1000; i++)
+    {      
+        if(taster1 == 1) counter++;
+        else break;
+       
+       
+    }
+    if(counter > 500)
+    myledsarray = (myledsarray + 1) % 256;
+   
+}
+ 
+void decrement()
+{
+    int count = 0;
+    for(int i = 0;i < 1000; i++)
+    {      
+        if(taster2 == 1) count++;
+        else break;
+       
+    }
+    if(count > 500)
+    { 
+        if(myledsarray == 0) myledsarray = 255;
+        else myledsarray = (myledsarray - 1) % 256;
+    }
+   
+}
+ 
+int main()
+{
+   
+   
+    InterruptIn taster1(dp1);
+    InterruptIn taster2(dp2);
+    myledsarray= 0;
+    enable = 0;
+       
+   
+   
+    while(1)
+    {
+        taster1.rise(&enlarge);
+        taster2.rise(&decrement);
+    }
+   
+   
+}
\ No newline at end of file
diff -r 000000000000 -r c815fa07c2ef mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Mar 10 11:00:00 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8e73be2a2ac1
\ No newline at end of file