![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Example of an "extern" declaration to reuse a global variable defined in one file in another file.
Dependencies: mbed
myWait.cpp
00001 #include "mbed.h" 00002 #include "myWait.h" 00003 00004 // extern declares that the global variable greenLed is defined in a different source file 00005 extern DigitalOut greenLed; 00006 00007 // definition of our custom wait function 00008 void myWait(float t) { 00009 greenLed=0; //turn on 00010 wait(t); //wait 00011 greenLed=1; //turn off 00012 }
Generated on Tue Jul 12 2022 18:34:01 by
![doxygen](doxygen.png)