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
main.cpp
- Committer:
- kinii
- Date:
- 2021-07-13
- Revision:
- 0:598029dcf103
File content as of revision 0:598029dcf103:
#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);
}
}