
On board led brightness change
Revision 0:1e577fb904c0, committed 2022-05-20
- Comitter:
- zatharv
- Date:
- Fri May 20 07:55:34 2022 +0000
- Commit message:
- .
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 Fri May 20 07:55:34 2022 +0000 @@ -0,0 +1,22 @@ +// LED brightness control +#include "mbed.h" + +PwmOut red(LED1); +PwmOut extled(PTC13); + +int main() { + while(1) { + for(float i = 0; i<=1; i+=0.01) + { + red = i; + extled = i; + wait(0.1); + } + for(float i = 1;i>=0;i-=0.01) + { + red = i; + extled = i; + wait(0.1); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri May 20 07:55:34 2022 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file