han back
/
CLEO_CDS
SMART CLEO CDS
Diff: main.cpp
- Revision:
- 0:2d4f287f9900
diff -r 000000000000 -r 2d4f287f9900 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Sep 28 02:10:35 2017 +0000 @@ -0,0 +1,22 @@ +#include "mbed.h" +#include "TextLCD.h" + +PinName pin_CDS = PB_0; + +AnalogIn adc_CDS(pin_CDS); + +// rs, rw, e, d0-d3 +TextLCD lcd(PB_12, PB_13, PB_14, PB_15, PA_9, PA_10, PA_11); + +int main() { + + int ADC_Data; + lcd.printf(" CDS Program\n"); + lcd.printf(" ADC Data : "); + while(1) { + ADC_Data = adc_CDS.read()*4095; + lcd.locate(12, 1); + lcd.printf("%4d", ADC_Data); + wait(1); + } +}