LED hello world.

Dependencies:   mbed

Committer:
chu3098
Date:
Wed Feb 15 05:26:56 2017 +0000
Revision:
1:b6bc26809ad3
Parent:
0:321920efbac6
slowdown LED1 blinking rate.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
chu3098 0:321920efbac6 1 #include "mbed.h"
chu3098 0:321920efbac6 2
chu3098 0:321920efbac6 3 DigitalOut myled(LED1);
chu3098 0:321920efbac6 4
chu3098 0:321920efbac6 5 int main() {
chu3098 0:321920efbac6 6 while(1) {
chu3098 0:321920efbac6 7 myled = 1; // LED is ON
chu3098 1:b6bc26809ad3 8 wait(0.5); // 200 ms
chu3098 0:321920efbac6 9 myled = 0; // LED is OFF
chu3098 1:b6bc26809ad3 10 wait(1.5); // 1 sec
chu3098 0:321920efbac6 11 }
chu3098 0:321920efbac6 12 }