LED hello world

Dependencies:   mbed

Committer:
Praktikant
Date:
Fri Apr 08 13:22:32 2016 +0000
Revision:
0:fb66e57f89c4
Child:
1:1d60dc3c3b08
added led2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Praktikant 0:fb66e57f89c4 1 #include "mbed.h"
Praktikant 0:fb66e57f89c4 2
Praktikant 0:fb66e57f89c4 3 DigitalOut myled(LED1);
Praktikant 0:fb66e57f89c4 4 DigitalOut myled2(LED2);
Praktikant 0:fb66e57f89c4 5
Praktikant 0:fb66e57f89c4 6 int main() {
Praktikant 0:fb66e57f89c4 7 while(1) {
Praktikant 0:fb66e57f89c4 8 myled = 1; // LED is ON
Praktikant 0:fb66e57f89c4 9 myled2 = 0;
Praktikant 0:fb66e57f89c4 10 wait(0.2); // 200 ms
Praktikant 0:fb66e57f89c4 11 myled = 0; // LED is OFF
Praktikant 0:fb66e57f89c4 12 myled2 = 1;
Praktikant 0:fb66e57f89c4 13 wait(0.2); // 1 sec
Praktikant 0:fb66e57f89c4 14 }
Praktikant 0:fb66e57f89c4 15 }