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:3a4784da8745, committed 2016-10-13
- Comitter:
- yyue
- Date:
- Thu Oct 13 09:19:45 2016 +0000
- Commit message:
- Created my library.
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/elec350.lib Thu Oct 13 09:19:45 2016 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/yyue/code/elec350/#6257e8e853e5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Oct 13 09:19:45 2016 +0000
@@ -0,0 +1,31 @@
+#include "mbed.h"
+#include "Led.h"
+#include "Button.h"
+Led myled(PD_15);
+Led myled1(PD_12);
+Led myled2(PD_13);
+Led myled3(PD_14);
+Button button(PA_0);
+int main()
+{
+ float delay = 0.01f;
+ while(1) {
+ while(button.isPressed()) {
+ myled.switchOff();
+ myled1.switchOff();
+ myled2.switchOff();
+ myled3.switchOff();
+ int led = rand() % 4;
+ if (led == 0) {
+ myled.flash(0.1);
+ } else if (led == 1) {
+ myled1.flash(0.1);
+ } else if (led==2) {
+ myled2.flash(0.1);
+ } else {
+ myled3.flash(0.1);
+ }
+ wait(delay);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Oct 13 09:19:45 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/abea610beb85 \ No newline at end of file