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:
- cwardlaw
- Date:
- 2016-09-24
- Revision:
- 0:82e77230d7bb
File content as of revision 0:82e77230d7bb:
/**************************************************************
/ Simple program program to show basic program structure
/
/ The program flashes attached LEDs for 1 second sequentially and repeats indeffinitely.
/
/**************************************************************/
#include "mbed.h"
DigitalOut yelLED(p22); // name attached LED p22
DigitalOut greLED(p23); // name attached LED p23
DigitalOut redLED(p24); // name attached LED p24
int main() {
while(1) { // repeat indefinitely
yelLED = 1; // activates yellow LED
wait(1); // pauses for a second
yelLED = 0; // deactivates yellow LED
wait(1); // pauses for a second
greLED = 1; // activates green LED
wait(1); // pauses for a second
greLED = 0; // deactivates green LED
wait(1); // pauses for a second
redLED = 1; // activates red LED
wait(1); // pauses for a second
redLED = 0; // deactivates red LED
}
}