DigitalInOut Hello World
Fork of DigitalInOut_HelloWorld_Mbed by
Use
The DigitalInOut API can be used to both read and write a digital pin. Use the output() and input() function calls to switch modes and then use just like you would DigitalIn or DigitalOut.
API
API reference.
Import librarymbed
Diff: main.cpp
- Revision:
- 3:e4004b2e39ad
- Parent:
- 0:0d0417932681
- Child:
- 4:3f69262115b3
diff -r 22178238d458 -r e4004b2e39ad main.cpp --- a/main.cpp Sun Sep 21 19:15:17 2014 +0000 +++ b/main.cpp Sun Sep 21 19:17:17 2014 +0000 @@ -4,8 +4,9 @@ int main() { pin.output(); - pin = 0; + pin = 0; // write pin value wait_us(500); pin.input(); + // can read pin value here wait_us(500); } \ No newline at end of file