Platform : mbed LPC1114FN28 , pwmが更新する度に長時間停波するので今回の用途にはつかえない

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
maxonK
Date:
Tue May 05 08:25:50 2015 +0000
Commit message:
0.5s???pwm?????????????????mbed?????pwm?????????????????????????

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
diff -r 000000000000 -r 5ac8ea653724 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue May 05 08:25:50 2015 +0000
@@ -0,0 +1,18 @@
+#include "mbed.h"
+
+AnalogIn position(dp4);
+PwmOut servo(dp1);
+
+Serial device (USBTX,USBRX);
+
+int main()
+{
+    // servo requires a 20ms period
+    servo.period(0.015f);
+    while (1) {
+        wait(0.5);
+            // servo position determined by a pulse width between 1-2ms
+            servo.pulsewidth(0.001f + 0.001f * position);
+
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 5ac8ea653724 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue May 05 08:25:50 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8ab26030e058
\ No newline at end of file