ece4180_team / Mbed 2 deprecated lab2_part7

Dependencies:   mbed

Files at this revision

API Documentation at this revision

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