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:fd8b7f396f9c, committed 2015-12-10
- Comitter:
- alejandroforero
- Date:
- Thu Dec 10 15:47:50 2015 +0000
- Commit message:
- increment and decrement of PWM in an output
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 Dec 10 15:47:50 2015 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+/* view a PWM in an output with increment and decrement. anode led connected to PWM pin (8-J1 or PTA1 or D3 are equal) and cathode to ground (pin 14-J2)
+with 330ohms resistor. */
+
+PwmOut led (D3);
+float value =0;
+
+int main(){
+
+ while (true) {
+
+ for(value=0.0;value<=1.0;value+=0.02){
+ led.write(value);
+ wait(0.02);
+ }
+
+ for(value=1.0;value>=0.0;value-=0.02){
+ led = value;
+ wait(0.02);
+ }
+
+
+
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Dec 10 15:47:50 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11 \ No newline at end of file