Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:8b5bb93ce8c7, committed 2014-03-10
- Comitter:
- tim004
- Date:
- Mon Mar 10 10:21:17 2014 +0000
- Commit message:
- LV1 - PAI - Grupa 1 - Tim004
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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Mar 10 10:21:17 2014 +0000
@@ -0,0 +1,61 @@
+#include "mbed.h"
+
+
+
+BusOut myleds(dp23, dp24, dp25, dp26, dp27, dp5, dp6, dp28);
+
+DigitalOut enable(dp14);
+DigitalIn taster1(dp1);
+DigitalIn taster2(dp2);
+
+void povecaj()
+{
+ int br=0;
+ for(int i=0;i<1000;i++)
+ {
+ if(taster1==1) br++;
+ else break;
+
+
+ }
+ if(br>600)
+ myleds = (myleds + 1)%256;
+
+}
+
+void smanji()
+{
+ int br=0;
+ for(int i=0;i<1000;i++)
+ {
+ if(taster2==1) br++;
+ else break;
+
+ }
+ if(br>600)
+ {
+ if(myleds==0) myleds = 255;
+ else myleds = (myleds - 1)%256;
+ }
+
+}
+
+int main()
+{
+
+
+ InterruptIn taster1(dp1);
+ InterruptIn taster2(dp2);
+ myleds = 0;
+ enable = 0;
+
+
+
+ while(1)
+ {
+ taster1.rise(&povecaj);
+ taster2.rise(&smanji);
+ }
+
+
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Mar 10 10:21:17 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/8e73be2a2ac1 \ No newline at end of file