learn the Busin Class to realize that 2 keys control the lights
Dependencies: mbed
Fork of BusIn_HelloWorld by
main.cpp@2:b22e7d5a6872, 2014-09-21 (annotated)
- Committer:
- mbedAustin
- Date:
- Sun Sep 21 17:56:02 2014 +0000
- Revision:
- 2:b22e7d5a6872
- Parent:
- 0:5e474ece410b
- Child:
- 3:fa8283d98f9a
added note about pins being different between platforms;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:5e474ece410b | 1 | #include "mbed.h" |
mbed_official | 0:5e474ece410b | 2 | |
mbedAustin | 2:b22e7d5a6872 | 3 | BusIn nibble(p5, p6, p18, p11); // change pins according to platform |
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 | } |