Rob Toulson / Mbed 2 deprecated PE_05-03_PWMFrequency

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
robt
Date:
Mon Oct 15 21:18:09 2012 +0000
Commit message:
by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"

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 Oct 15 21:18:09 2012 +0000
@@ -0,0 +1,14 @@
+/*Program Example 5.3: Uses analog input to control PWM period
+                                                                     */
+#include "mbed.h"
+PwmOut PWM1(p21);
+AnalogIn Ain(p20);
+
+int main() {
+    while(1){
+      PWM1.period(Ain/10+0.001);            // set PWM period 
+      PWM1=0.5;                             // set duty cycle
+      wait(0.5);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Oct 15 21:18:09 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/cd19af002ccc
\ No newline at end of file