Augusto Panecatl
/
PWM_RGB
PWM + RGB code example for FRDM-KL25Z
Revision 0:cb11ef198767, committed 2014-06-04
- Comitter:
- APanecatl
- Date:
- Wed Jun 04 19:25:10 2014 +0000
- Commit message:
- Rev 1.0;
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 Wed Jun 04 19:25:10 2014 +0000 @@ -0,0 +1,27 @@ +#include "mbed.h" + +PwmOut Red(LED_RED); +//PwmOut Green(LED_GREEN); + + + +int main() +{ + Red.period_ms(2000); + // Green.period(1000); + // Red.pulsewidth_ms(500); + int x; + x=1; + + while(1) + { + Red.pulsewidth_ms(x); + x=x+2; + wait(1); + if(x==1000) + { + x=1; + } + } + +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Jun 04 19:25:10 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/0b3ab51c8877 \ No newline at end of file