run with easy module shield
Dependencies: mbed
Fork of CDS_HelloWorld_WIZwiki-W7500 by
Diff: main.cpp
- Revision:
- 5:07cf6e09cd27
- Parent:
- 4:9866fbe66750
- Child:
- 7:17a6ae52f531
--- a/main.cpp Fri Jul 24 01:32:06 2015 +0000 +++ b/main.cpp Tue Aug 04 07:01:24 2015 +0000 @@ -1,13 +1,12 @@ #include "mbed.h" -DigitalOut myled_R(D9); // LED_RED on easy module shield -DigitalOut myled_G(D10); // LED_GREEN on easy module shield -DigitalOut myled_B(D11); // LED_BLUE on easy module shield -AnalogIn CDS(A1); // Analog Input Pin A1 +DigitalOut myled_R(LED_RED); // LED_RED on WIZwiki-W7500 +DigitalOut myled_B(LED_BLUE); // LED_BLUE on WIZwiki-W7500 +AnalogIn CDS(A0); // Analog Input Pin A0 int main() { - printf("Hello WizWIki-W7500!\n\r"); - printf("===========================================\n\r"); + printf("Hello WizWIki-W7500!\r\n"); + printf("==============================\r\n"); int CDS_data = 0; double CDS_vol = 0; @@ -20,19 +19,17 @@ printf("CDS Data : %3d\r\n",CDS_data); //CDS Sensor Voltage data printf("CDS Voltage : %3.3lfV\r\n",CDS_vol); - printf("===========================================\n\r"); + printf("===========================\r\n"); + wait(1.0); - wait(1); - //Status is dark and RED LED ON, the others OFF + //Status is Dark and RED LED ON, BLUE LED OFF if(CDS_data < 500){ myled_R = 1; - myled_G = 0; myled_B = 0; } - //Status is bright and BLUE LED ON, the others OFF + //Status is Bright and BLUE LED ON, RED LED OFF else { myled_R = 0; - myled_G = 0; myled_B = 1; } }