You are viewing an older revision! See the latest version

DigitalInOut

Table of Contents

  1. Hello World!
  2. API
  3. Related

/media/uploads/mbedofficial/digitalin_interfaces.png

The DigitalInOut interface is used as a bi-directional digital pin, used to read the value of a digital pin when set as an input, or write the value when set as an output.

Any of the numbered mbed pins can be used as a DigitalInOut.

Hello World!

Reset a 1-Wire device

 
#include "mbed.h"

DigitalInOut pin(p5);

int main() {
    pin.output();
    pin = 0;     
    wait_us(500);
    pin.input();
    wait_us(500);
}

API

API summary

[error loading api]

All wikipages