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

Dependencies:   mbed

Fork of BusIn_HelloWorld by mbed official

main.cpp

Committer:
mbedAustin
Date:
2014-09-21
Revision:
2:b22e7d5a6872
Parent:
0:5e474ece410b
Child:
3:fa8283d98f9a

File content as of revision 2:b22e7d5a6872:

#include "mbed.h"

BusIn nibble(p5, p6, p18, p11); // change pins according to platform

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
        }
    }
}