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:
- chenlaoshi
- Date:
- 2014-10-18
- Revision:
- 0:f9a53979b663
File content as of revision 0:f9a53979b663:
#include "mbed.h"
DigitalOut myled(PA_5);
void delay(long int i);
int main()
{
int ledx ,cycle=4000;
while(1)
{
for(ledx=0;ledx<cycle;ledx++)
{
myled = 1; // LED is ON
delay(ledx);
myled = 0; // LED is ON
delay(cycle-ledx);
}
for(ledx=cycle;ledx>0;ledx--)
{
myled = 1; // LED is ON
delay(ledx);
myled = 0; // LED is ON
delay(cycle-ledx);
}
}
}
void delay(long int i)
{
while(i--);
}