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:
- tmaly45
- Date:
- 2018-09-20
- Revision:
- 0:09571003fc2e
- Child:
- 1:0a1e7d18b69c
File content as of revision 0:09571003fc2e:
#include "mbed.h"
#include "time.h"
DigitalOut myled[5] = {p25, p26, p27, p28, p29};
int main() {
int i = 0;
char enter_key;
Timer t;
t.start();
printf("Ready?\n\r");
scanf("%c", &enter_key);
srand(t.read_ms());
while(1) {
i = (rand()%4);
myled[i] = 1;
wait(1);
myled[i] = 0;
printf("%d\n\r", i);
}
}