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
main.cpp
- Committer:
- mbedAustin
- Date:
- 2014-09-21
- Revision:
- 3:e4004b2e39ad
- Parent:
- 0:0d0417932681
- Child:
- 4:3f69262115b3
File content as of revision 3:e4004b2e39ad:
#include "mbed.h" DigitalInOut pin(p5); int main() { pin.output(); pin = 0; // write pin value wait_us(500); pin.input(); // can read pin value here wait_us(500); }