Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of DigitalIn_HelloWorld_WIZwiki-W7500 by
main.cpp
00001 /* Digital Input Example Program */ 00002 00003 #include "mbed.h" 00004 00005 DigitalOut myled_R(LED1); // LED_RED on WIZwiki-W7500 00006 00007 DigitalIn mysw(D10); // push switch 00008 00009 int main() 00010 { 00011 int sw_val; 00012 00013 while(1) { 00014 00015 sw_val = mysw.read(); // Read Digital input value 00016 00017 printf("Digital Input value is %d \n\r", sw_val); // output Digital Input value 00018 00019 if(sw_val == 1) // switch pushed, Red LED ON 00020 { 00021 myled_R = 0; 00022 } 00023 else 00024 { 00025 myled_R = 1; // the others, Red LED OFF 00026 } 00027 00028 wait(0.2); 00029 } 00030 }
Generated on Wed Jul 13 2022 02:12:49 by
1.7.2
