You are viewing an older revision! See the latest version

BusInOut

Table of Contents

  1. Hello World!
  2. API
  3. Related

/media/uploads/mbedofficial/digitalin_interfaces.png

The BusInOut interface is used as a bi-directional bus that collects together a number of DigitalInOut pins that can be read and written as one value.

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

Hello World!

#include "mbed.h"

BusInOut pins(p5, p10, p7);

int main() {
    pins.output();
    pin = 0x3;     
    wait(1);
    pins.input();
    wait(1);
    if(pins == 0x6) {
        printf("Hello!\n");
    }
}

API


All wikipages