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.
Revision 0:e53d3f40f2c7, committed 2012-10-15
- 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