MARIO DERRANT
/
analiogicoin
analog in kl46z
Revision 0:c7a59e1e41f8, committed 2014-07-18
- Comitter:
- mderrant
- Date:
- Fri Jul 18 22:00:40 2014 +0000
- Commit message:
- analog in
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 c7a59e1e41f8 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jul 18 22:00:40 2014 +0000 @@ -0,0 +1,16 @@ +#include "mbed.h" + +AnalogIn ain(PTB0); +DigitalOut led(LED1); +PwmOut anout(LED_RED); + +int main() { + while (1){ + if(ain > 0.7) { + led = 1; + } else { + led = 0; + } + anout = ain/100; + } +} \ No newline at end of file
diff -r 000000000000 -r c7a59e1e41f8 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Jul 18 22:00:40 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/8e73be2a2ac1 \ No newline at end of file