![](/media/cache/profiles/09bd2862fe3035ad3223816b439045e3.50x50_q85.jpg)
光センサ
Fork of CDS_LCD by
main.cpp
- Committer:
- MasudaToshio
- Date:
- 2013-05-23
- Revision:
- 0:48b9e99fafc8
File content as of revision 0:48b9e99fafc8:
#include "mbed.h" #include "TextLCD.h" AnalogIn CDS(p16); TextLCD lcd(p24, p26, p27, p28, p29, p30); ///////////////////////////////////////////////////// // main ///////////////////////////////////////////////////// int main(void) { float a_in , t_cds ; lcd.cls(); while(1) { a_in = ( CDS ); t_cds = ( 2.7 * exp( a_in ) + ( -2.55 ) ) ; t_cds = pow( 10 , t_cds ) ; lcd.locate(0,0); lcd.printf("%3.0F lx %5.3F V", t_cds, a_in); wait(.5); } return 0; }