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 5:3121f8550958, committed 2019-01-09
- Comitter:
- odb
- Date:
- Wed Jan 09 04:19:39 2019 +0000
- Parent:
- 4:da46bcd42799
- Commit message:
- LED
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 |
--- a/main.cpp Fri Feb 03 08:33:25 2017 +0000
+++ b/main.cpp Wed Jan 09 04:19:39 2019 +0000
@@ -1,12 +1,34 @@
#include "mbed.h"
-DigitalOut (myled,PC_9);
-
+DigitalOut mybuzzer(PC_4);
+PwmOut mypwmR(PB_5);
+PwmOut mypwmG(PB_3);
+PwmOut mypwmB(PA_10);
+BusOut motor(PB_13, PB_14, PB_15, PB_1);
+DigitalOut myled[4] = { PC_9, PB_2, PC_2, PC_3};
+DigitalIn mysw[4] = {PC_10,PC_11, PC_12, PA_13 };
int main() {
+ int i;
while(1) {
- myled = 1; // LED is ON
- wait(1.0); // 200 ms
- myled = 0; // LED is OFF
- wait(1.0); // 1 sec
+ /*
+ for (i= 0; i< 4 ;i++)
+ {
+ myled[i] = 1; // LED is ON
+ mybuzzer = 1;
+ wait(0.5); // 200 ms
+ myled[i] = 0; // LED is OFF
+ mybuzzer = 0;
+ wait(0.5); // 1 sec
+ }
+ */
+ for( i = 0; i < 4 ; i++)
+ {
+ if(!(mysw[i]))
+ {
+ myled[i] = 1;
+ wait(1);
+ }
+ else myled[i] = 0;
+ }
}
}
--- a/mbed.bld Fri Feb 03 08:33:25 2017 +0000 +++ b/mbed.bld Wed Jan 09 04:19:39 2019 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/ad3be0349dc5 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/aa5281ff4a02 \ No newline at end of file