Blinky test program for Black Pill board with STM32F411CEU6

Committer:
SpotlightKid
Date:
Sat Jun 27 20:04:44 2020 +0000
Revision:
0:ec03923ace26
Blinky test program for Black Pill board withl STM32F411CEU6

Who changed what in which revision?

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