![](/media/cache/profiles/79d51f4d7e4d54d54b55519c3b462d00.50x50_q85.jpg)
Measuring the brightness.
Revision 0:a00ca10c1f2b, committed 2012-06-17
- Comitter:
- nobuki
- Date:
- Sun Jun 17 03:44:05 2012 +0000
- Commit message:
- Version 1
Changed in this revision
diff -r 000000000000 -r a00ca10c1f2b TextLCD.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TextLCD.lib Sun Jun 17 03:44:05 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/simon/code/TextLCD/#44f34c09bd37
diff -r 000000000000 -r a00ca10c1f2b main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Jun 17 03:44:05 2012 +0000 @@ -0,0 +1,36 @@ +#include "mbed.h" +#include "TextLCD.h" + +TextLCD g_lcd(p24, p26, p27, p28, p29, p30); // RS, E, DB4, DB5, DB6, DB7 +AnalogIn g_analogin(p15); + +int main() { + wait(0.001); + g_lcd.cls(); wait(0.001); + g_lcd.locate(0, 0); + + while(1) { + double dV = g_analogin * 3.3; + + double dR = 0.0; + if( 0.005 < (3.3 - dV) ) + { + dR = 10 * 1000 * dV / (3.3 - dV); + } + + g_lcd.cls(); wait(0.001); + g_lcd.locate(0, 0); + g_lcd.printf( "%5.2lf[V]", dV ); + g_lcd.locate(0, 1); + if( 0.0 == dR ) + { + g_lcd.printf( "Infinity[ohm]" ); + } + else + { + g_lcd.printf( "%8.2lf[ohm]", dR ); + } + + wait(1.0); + } +}
diff -r 000000000000 -r a00ca10c1f2b mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Jun 17 03:44:05 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/737756e0b479