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:366ff44cdee8, committed 2016-11-03
- Comitter:
- papuxtream
- Date:
- Thu Nov 03 06:50:30 2016 +0000
- Commit message:
- brightness control of led by PWM Technic
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 Nov 03 06:50:30 2016 +0000
@@ -0,0 +1,16 @@
+#include "mbed.h"
+DigitalIn ButtonUp(p5,PullUp);
+DigitalIn ButtonDown(p6,PullUp);
+PwmOut led(p26);
+int val=0;
+int main() {
+ while(1) {
+ if((ButtonUp==1)&&(val<255))
+ {wait_ms(10);
+ val++;}
+ else if((ButtonDown==1)&&(val>0))
+ {wait_ms(10);
+ val--;}
+ val=led;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Nov 03 06:50:30 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/6f327212ef96 \ No newline at end of file