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.
Dependencies: mbed
main.cpp
- Committer:
- matt495
- Date:
- 2018-09-25
- Revision:
- 0:9a2d6e5f53d0
File content as of revision 0:9a2d6e5f53d0:
/****************************************************************
/ Simple program to show basic program structure
/
/ The program flashes onboard LED #1, #2 and #3 on/off in sequence for 1 second and continues this indefinitely.
*************************************************************/
#include "mbed.h"
DigitalOut myled(p23); // use onboard LED #1 (red)
DigitalOut myled2(p25); // use onboard LED #2 (green)
DigitalOut myled3(p24); // use onboard LED #3 (yellow)
int main() {
while(1) { // repeat indefinitely
myled = 1; // turn on LED #1
myled2 = 1; // turn on LED #2
myled3 = 1; // turn on LED #3
wait(1); // wait 1s
myled = 0; // turn off LED #1
myled2 = 0; // turn off LED #2
myled3 = 0; // turn off LED #3
wait(1); // wait 1s
}
}