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.
Dependencies: mbed
Revision 0:74a586aeaa55, committed 2015-11-23
- Comitter:
- schoeni_91
- Date:
- Mon Nov 23 17:50:55 2015 +0000
- Commit message:
- Test Note (2)
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 74a586aeaa55 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Nov 23 17:50:55 2015 +0000
@@ -0,0 +1,86 @@
+#include "mbed.h"
+
+BusOut lb(P1_13,P1_12,P1_7,P1_6,P1_4,P1_3,P1_1,P1_0,LED4,LED3,LED2,LED1);
+DigitalIn Sw1 (P0_10);
+DigitalIn Sw2 (P0_15);
+
+void RunLigthLeft();
+void RunLigthRight();
+void Blinker();
+
+int main()
+{
+ while(1)
+ {
+ if(Sw1==1)
+ {
+ RunLigthLeft();
+ }
+
+ if(Sw2==1)
+ {
+ RunLigthRight();
+ }
+
+ if (Sw1==1 && Sw2 ==1)
+ {
+ Blinker();
+ }
+}
+
+}
+void RunLigthLeft()
+{
+ int i;
+ lb=1;
+ wait_ms(200);
+ for (i=1;i<=2;i++)
+ {
+ lb=lb<<1;
+ lb=lb|1;
+ wait_ms(200);
+ }
+
+
+ for(i=1;i<=11;i++)
+ {
+ lb=lb <<1;
+ wait_ms(200);
+ }
+}
+
+void RunLigthRight()
+{
+ int i;
+ lb=2048;
+ wait_ms(200);
+ for (i=1;i<=2;i++)
+ {
+ lb=lb>>1;
+ lb=lb|1;
+ wait_ms(200);
+
+ }
+
+ for(i=1;i<=11;i++)
+ {
+ lb=lb >>1;
+ wait_ms(200);
+ }
+
+ }
+
+
+void Blinker()
+{ int i=0;
+for(i=0; i<10; i++)
+{
+lb = 0x2AAAA; wait_ms(200);
+lb = lb <<1; lb=lb|1;
+wait_ms(200);
+}
+
+}
+
+
+
\ No newline at end of file
diff -r 000000000000 -r 74a586aeaa55 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Nov 23 17:50:55 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11 \ No newline at end of file