Gerardo Carmona
/
08_Leds_Intermitentes
Intermittent Leds, depends of the value of an analog pin
Revision 0:c3e16ba86b4d, committed 2013-10-09
- Comitter:
- gcarmonar
- Date:
- Wed Oct 09 21:28:09 2013 +0000
- Commit message:
- Ver1.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 |
diff -r 000000000000 -r c3e16ba86b4d main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Oct 09 21:28:09 2013 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" + +PwmOut rled(LED3); +PwmOut bled(LED1); +AnalogIn pot(A0); + +float pot_time; + +int main() { + +rled = 1; +bled = 1; + + while(1) { + pot_time = (pot * .450) + 0.050; + rled = 1; + bled = 0; + wait(pot_time); + rled = 0; + bled = 1; + wait(pot_time); + } +}
diff -r 000000000000 -r c3e16ba86b4d mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Oct 09 21:28:09 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f \ No newline at end of file