Simon Ford / Mbed 2 deprecated GlobalPinAssignments

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 // Example showing multiple files using the same mbed interface instances
00002 // sford
00003 //
00004 //  * The interfaces we want are in interfaces.h/cpp (e.g. our digital outputs)
00005 //    - they are instanced in the .cpp file so they exist
00006 //    - they are listed in the .h file as extern, so others can use them
00007 //  * Both main and otheruser include interfaces.h, so can both use it
00008 
00009 #include "mbed.h"
00010 #include "interfaces.h"
00011 #include "otheruser.h"
00012 
00013 int main() {
00014     while(1) {
00015         led1 = led3 = 0;    // main uses led1, defined in interfaces
00016         led2 = led4 = 1;
00017         wait(0.2);
00018         otheruser();        // otheruser uses led1, defined in interfaces
00019         wait(0.2);
00020     }
00021 }