test code to log ldr value

Dependencies:   mbed

main.cpp

Committer:
ganesh70508
Date:
2017-01-05
Revision:
0:e2162e735bfe

File content as of revision 0:e2162e735bfe:

#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);
    }
}