shao ziyang
/
ST_Nucleo_F091RC_Measure_LightIntensity
using ST Nucleo F091RC on board LED to measure light intensity.
Revision 0:4f9c5c2ed55e, committed 2015-01-30
- Comitter:
- shaoziyang
- Date:
- Fri Jan 30 02:22:27 2015 +0000
- Commit message:
- use F091RC on board LED1 measure light intensity
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 4f9c5c2ed55e main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jan 30 02:22:27 2015 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" + +Serial pc(USBTX,USBRX); + +int main() { + + DigitalOut myled(LED1); + + myled = 0; + + while(1) { + + DigitalOut myled(LED1); + myled = 1; + wait(0.495); + myled = 0; + wait(0.005); + + AnalogIn Light(LED1); + + pc.printf("%d\r\n", Light.read_u16()>>4); + + } +} \ No newline at end of file
diff -r 000000000000 -r 4f9c5c2ed55e mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Jan 30 02:22:27 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5 \ No newline at end of file