BusInOut Hello World

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002  
00003 BusInOut pins(p5, p10, p7);
00004  
00005 int main() {
00006     while(1) {
00007         pins.output();
00008         pins = 0x3;
00009         wait(1);
00010         pins.input();
00011         wait(1);
00012         if(pins == 0x6) {
00013             printf("Hello!\n");
00014         }
00015     }
00016 }