BusIn HelloWorld

Fork of BusIn_HelloWorld by Mbed

Use

BusIn is an abstraction that takes any pins and makes them appear as though they are linearly memory mapped for ease of use. This abstraction is useful for checking multiple inputs in a single pass. In general this abstraction can be used to make code less cluttered, clearer, and take less time to write.

Note

Please pay attention to the ordering of pins in the initialization. The order pins are initialized in are the reverse order that bits are OR'd together.

API

API reference.

Import librarymbed

No documentation found.
Committer:
mbed_official
Date:
Mon Feb 11 17:14:12 2013 +0000
Revision:
0:5e474ece410b
Child:
2:b22e7d5a6872
BusIn Hello World

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 0:5e474ece410b 1 #include "mbed.h"
mbed_official 0:5e474ece410b 2
mbed_official 0:5e474ece410b 3 BusIn nibble(p5, p6, p18, p11);
mbed_official 0:5e474ece410b 4
mbed_official 0:5e474ece410b 5 int main() {
mbed_official 0:5e474ece410b 6 while(1) {
mbed_official 0:5e474ece410b 7 switch(nibble) {
mbed_official 0:5e474ece410b 8 case 0x3: printf("Hello!\n"); break; // p5 and p6 are 1
mbed_official 0:5e474ece410b 9 case 0x8: printf("World!\n"); break; // p11 is 1
mbed_official 0:5e474ece410b 10 }
mbed_official 0:5e474ece410b 11 }
mbed_official 0:5e474ece410b 12 }