learn the Busin Class to realize that 2 keys control the lights

Dependencies:   mbed

Fork of BusIn_HelloWorld by mbed official

main.cpp

Committer:
mbed_official
Date:
2013-02-11
Revision:
0:5e474ece410b
Child:
2:b22e7d5a6872

File content as of revision 0:5e474ece410b:

#include "mbed.h"

BusIn nibble(p5, p6, p18, p11);

int main() {
    while(1) {
        switch(nibble) {
            case 0x3: printf("Hello!\n"); break; // p5 and p6 are 1
            case 0x8: printf("World!\n"); break; // p11 is 1
        }
    }
}