![](/media/cache/group/mbed-logo-square-512_3.png.50x50_q85.png)
DigitalIn Hello World
Fork of DigitalIn_HelloWorld_Mbed by
Use
The DigitalIn API is used to read a digital pin. The value will be either 0 or 1. Buttons and switches are some of the more common digital inputs.
API
API reference.
Import librarymbed
Diff: main.cpp
- Revision:
- 8:ef3558374977
- Parent:
- 7:64e67ec4441e
- Child:
- 9:954ac88dda04
diff -r 64e67ec4441e -r ef3558374977 main.cpp --- a/main.cpp Fri Mar 27 21:24:54 2015 +0000 +++ b/main.cpp Fri Mar 27 22:07:54 2015 +0000 @@ -20,13 +20,13 @@ int main() { - // check mypin object is initialized and connected to a pin + // check mypin object is initialized and connected to a pin if(mypin.is_connected()) { printf("mypin is connected and initialized! \n\r"); } // Optional: set mode as PullUp/PullDown/PullNone/OpenDrain - mypin.mode(PullNone); / + mypin.mode(PullNone); // press the button and see the console / led change while(1) {