Simple PWM for DC motor on A4 and A5
Dependencies: mbed
Revision 0:60a2d34f6420, committed 2017-03-09
- Comitter:
- ewoud
- Date:
- Thu Mar 09 11:06:13 2017 +0000
- Commit message:
- Simple PWM for DC motor
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 Thu Mar 09 11:06:13 2017 +0000
@@ -0,0 +1,13 @@
+#include "mbed.h"
+
+//PWM output channel
+PwmOut PWM1(A4);
+PwmOut PWM2(A5);
+
+int main()
+{
+ PWM1.period_ms(500);
+ PWM2.period_ms(500);
+ PWM1.pulsewidth_ms(500);
+ PWM2.pulsewidth_ms(500);
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Mar 09 11:06:13 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/e1686b8d5b90 \ No newline at end of file