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
Diff: main.cpp
- Revision:
- 0:598029dcf103
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Jul 13 12:35:21 2021 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+
+AnalogIn pwm_width(p20);
+AnalogIn pwm_period(p19);
+PwmOut p1(p21);
+
+int main() {
+ while(1) {
+ float pwm_p = pwm_width.read();
+ p1 = pwm_p;
+ float pwm_w = pwm_period.read()*1000;
+ p1.period_ms((int)pwm_w);
+ printf("p:%f, w:%f, pwm: %f \r\n", pwm_p, pwm_w, p1.read());
+ wait(1);
+
+ }
+}