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:
- oosattar
- Date:
- 2016-09-21
- Revision:
- 0:a5aeb2522cca
File content as of revision 0:a5aeb2522cca:
/****************************************************************
/ simple program to show basic program structure
/
/ the program flashes onboard LED #1 on/off and a rate of 1Hz
/
*****************************************************************/
#include "mbed.h"
DigitalOut myled(LED1);
int main() {
while(1) { //repeat indefinitly
uint8_t x = 0; //set start interger value as 0
while(x < 5) { //while "x" interger value is less than 5 run rest of program
myled = 1; //turn on LED 1
wait(1.0); //wait 1s
myled = 0; //turn LED 1 off
wait(1.0); //wait 1s
x= x + 1; //add 1 to "x" integer value
}
wait(5.0); //wait 5s
}
}