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:
- jcondon
- Date:
- 2010-09-27
- Revision:
- 0:1e686880e49e
File content as of revision 0:1e686880e49e:
#include "mbed.h"
#include "stdlib.h"
#define WAIT_TIME .02
#define w() wait(WAIT_TIME)
DigitalOut myled1(LED1);
DigitalOut myled2(LED2);
DigitalOut myled3(LED3);
DigitalOut myled4(LED4);
int number;
void blink(DigitalOut led) {
led = 1;
w();
led = 0;
w();
}
int main() {
while(1) {
number = rand();
if ((number % 4) == 0)
{
blink(myled1);
}
else if ((number % 4) == 1)
{
blink(myled2);
}
else if ((number % 4) == 2)
{
blink(myled3);
}
else
{
blink(myled4);
}
}
}