Fork of the GitHub

Committer:
DiegoOstuni
Date:
Thu Nov 14 11:17:28 2019 +0000
Revision:
0:57b2ec89b3bc
TEST

Who changed what in which revision?

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