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:a1a47e97f8aa, committed 2019-11-13
- Comitter:
- troshha
- Date:
- Wed Nov 13 10:29:52 2019 +0000
- Commit message:
- 10
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 Wed Nov 13 10:29:52 2019 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+
+PwmOut mypwm(PWM_OUT);
+
+DigitalOut led0(A0);
+DigitalOut led1(D2);
+DigitalOut led2(A2);
+DigitalIn buttonIn(PA_1, PullNone);
+
+
+int main() {
+
+ mypwm.period_ms(10);
+ mypwm.pulsewidth_ms(1);
+
+ printf("pwm set to %.2f %%\n", mypwm.read() * 100);
+
+ while(1) {
+ if (buttonIn == 1) {
+ led0 = 1;
+ wait(1);
+ led1 = 1;
+ wait(1);
+ led2 = 1;
+ wait(1);
+ }else if (buttonIn ==0) {
+ led0 = 1;
+ wait(1);
+ led1 = 1;
+ wait(1);
+ led2 = 1;
+ wait(1);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Nov 13 10:29:52 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file