Zoltan Hudak / Mbed OS mbed-os-bluepill
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers blinky.cpp Source File

blinky.cpp

00001 /* mbed Microcontroller Library
00002  * Copyright (c) 2019 ARM Limited
00003  * SPDX-License-Identifier: Apache-2.0
00004  */
00005 #ifdef MBED_BLINKY_EXAMPLE
00006 #ifndef MBED_TEST_MODE
00007 #include "mbed.h"
00008 
00009 // Blinking rate in milliseconds
00010 #define BLINKING_RATE_MS     500
00011 
00012 int main()
00013 {
00014     // Initialise the digital pin LED1 as an output
00015     DigitalOut led(LED1);
00016 
00017     while (true) {
00018         led = !led;           
00019         printf("Blinky\r\n");
00020         ThisThread::sleep_for(BLINKING_RATE_MS);
00021     }
00022 }
00023 #endif /* MBED_TEST_MODE */
00024 #endif /* MBED_BLINKY_EXAMPLE */