![](/media/cache/profiles/20200518_163046.jpg.50x50_q85.jpg)
Blinky for psoc 6 proto board
main.cpp@0:72aae15388e7, 2019-12-03 (annotated)
- Committer:
- reedas
- Date:
- Tue Dec 03 10:54:28 2019 +0000
- Revision:
- 0:72aae15388e7
simple cypress psoc6 proto board blink led program
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
reedas | 0:72aae15388e7 | 1 | /* mbed Microcontroller Library |
reedas | 0:72aae15388e7 | 2 | * Copyright (c) 2019 ARM Limited |
reedas | 0:72aae15388e7 | 3 | * SPDX-License-Identifier: Apache-2.0 |
reedas | 0:72aae15388e7 | 4 | */ |
reedas | 0:72aae15388e7 | 5 | |
reedas | 0:72aae15388e7 | 6 | #include "mbed.h" |
reedas | 0:72aae15388e7 | 7 | #include "platform/mbed_thread.h" |
reedas | 0:72aae15388e7 | 8 | |
reedas | 0:72aae15388e7 | 9 | |
reedas | 0:72aae15388e7 | 10 | // Blinking rate in milliseconds |
reedas | 0:72aae15388e7 | 11 | #define BLINKING_RATE_MS 500 |
reedas | 0:72aae15388e7 | 12 | |
reedas | 0:72aae15388e7 | 13 | |
reedas | 0:72aae15388e7 | 14 | int main() |
reedas | 0:72aae15388e7 | 15 | { |
reedas | 0:72aae15388e7 | 16 | // Initialise the digital pin LED1 as an output |
reedas | 0:72aae15388e7 | 17 | DigitalOut led(LED1); |
reedas | 0:72aae15388e7 | 18 | |
reedas | 0:72aae15388e7 | 19 | while (true) { |
reedas | 0:72aae15388e7 | 20 | led = !led; |
reedas | 0:72aae15388e7 | 21 | thread_sleep_for(BLINKING_RATE_MS); |
reedas | 0:72aae15388e7 | 22 | } |
reedas | 0:72aae15388e7 | 23 | } |