Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- WilliamMarshQMUL
- Date:
- 2019-01-09
- Revision:
- 1:bbbe0fae16f3
- Parent:
- 0:83abbbeb9a3d
- Child:
- 2:b13b343de0f5
File content as of revision 1:bbbe0fae16f3:
// Simple Example fo use of Threads on mbed OS 5 // Only need to include mbed.h #include "mbed.h" // Variable for a second thread Thread thread; DigitalOut ledA(LED1); // Red LED DigitalOut ledB(LED2); // Green LED // This method is run in the second thread void ledB_thread() { while (true) { wait(0.25); ledB = !ledB; } } // This is the main thread int main (void) { ledA = 1 ; // off ledB = 1 ; // off // start the second thread thread.start(callback(ledB_thread)); while (true) { wait(0.4); ledA = !ledA; } }