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:ab02d26640f5, committed 2022-09-19
- Comitter:
- mus3
- Date:
- Mon Sep 19 19:49:33 2022 +0000
- Commit message:
- lab2 part7 just one pwm output
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 Sep 19 19:49:33 2022 +0000
@@ -0,0 +1,13 @@
+#include "mbed.h"
+
+PwmOut control(p21);
+float volatile speed = 0.0f;
+int main() {
+ while(1) {
+ for (int i = 0; i < 10; i++) {
+ speed = (float) i / 10.0;
+ control = speed;
+ wait(1);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Sep 19 19:49:33 2022 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file