Dongha Shin / Mbed OS my-first-blinky
Committer:
dshin
Date:
Sun Mar 29 20:16:48 2020 +0000
Revision:
0:302424d154ab
Child:
2:c9a1ef1c71d4
my-first-blinky

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dshin 0:302424d154ab 1 /* mbed Microcontroller Library
dshin 0:302424d154ab 2 * Copyright (c) 2019 ARM Limited
dshin 0:302424d154ab 3 * SPDX-License-Identifier: Apache-2.0
dshin 0:302424d154ab 4 */
dshin 0:302424d154ab 5
dshin 0:302424d154ab 6 #include "mbed.h"
dshin 0:302424d154ab 7 #include "platform/mbed_thread.h"
dshin 0:302424d154ab 8
dshin 0:302424d154ab 9
dshin 0:302424d154ab 10 // Blinking rate in milliseconds
dshin 0:302424d154ab 11 #define BLINKING_RATE_MS 500
dshin 0:302424d154ab 12
dshin 0:302424d154ab 13
dshin 0:302424d154ab 14 int main()
dshin 0:302424d154ab 15 {
dshin 0:302424d154ab 16 // Initialise the digital pin LED1 as an output
dshin 0:302424d154ab 17 DigitalOut led(LED1);
dshin 0:302424d154ab 18
dshin 0:302424d154ab 19 while (true) {
dshin 0:302424d154ab 20 led = !led;
dshin 0:302424d154ab 21 thread_sleep_for(BLINKING_RATE_MS);
dshin 0:302424d154ab 22 }
dshin 0:302424d154ab 23 }