Scott Jeong
/
CDS_Sensor_WizWiki-W7500
use to WIZwiki-W7500. Sensing to CDS.
Revision 0:f6d98a2fee3b, committed 2015-06-29
- Comitter:
- nanjsk
- Date:
- Mon Jun 29 05:20:10 2015 +0000
- Commit message:
- use to WIZwiki-W7500. Sensing to CDS.
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 f6d98a2fee3b main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Jun 29 05:20:10 2015 +0000 @@ -0,0 +1,33 @@ +#include "mbed.h" + +DigitalOut myled(LED1); +AnalogIn CDS(A0); + +Serial pc(USBTX, USBRX); + +int main() { + pc.baud(115200); + wait(0.5f); + pc.printf("Hello WizWIki-W7500!\n\r"); + pc.printf("===========================================\n\r"); + int CDS_data = 0; + double CDS_vol = 0; + while(1) { + CDS_data = CDS.read()*1000; + CDS_vol = CDS.read()*3.3; + //CDS Seneor ADC Low Data + pc.printf("CDS Data : %3d\r\n",CDS_data); + //CDS Sensor Voltage data + pc.printf("CDS Voltage : %3.3lfV\r\n",CDS_vol); + pc.printf("===========================================\n\r"); + wait(1); + //Status is bright. + if(CDS_data < 600){ + myled = 1; + } + //Status is dark. + else { + myled = 0; + } + } +}
diff -r 000000000000 -r f6d98a2fee3b mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Jun 29 05:20:10 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/7cff1c4259d7 \ No newline at end of file