Ganesh Gore
/
LnTMadhExe1
test code to log ldr value
Revision 0:e2162e735bfe, committed 2017-01-05
- Comitter:
- ganesh70508
- Date:
- Thu Jan 05 11:00:59 2017 +0000
- Commit message:
- initial;
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 Jan 05 11:00:59 2017 +0000 @@ -0,0 +1,15 @@ +#include "mbed.h" + +AnalogIn ldr(PTB1); +Serial pc(USBTX, USBRX); // tx, rx +int main() { + unsigned int value; + while(1) { + if(pc.readable()) { + if (pc.getc() == 'A') + value = ldr*100.0; + pc.printf("%2d\n",value); + } + wait(0.01); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Jan 05 11:00:59 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/7c328cabac7e \ No newline at end of file