32 lines
620 B
C++
32 lines
620 B
C++
/* mbed Microcontroller Library
|
|
* Copyright (c) 2019 ARM Limited
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include "mbed.h"
|
|
|
|
|
|
// Blinking rate in milliseconds
|
|
#define BLINKING_RATE 500ms
|
|
|
|
DigitalOut led1(LED1);
|
|
DigitalOut led2(LED2);
|
|
DigitalOut led3(LED3);
|
|
DigitalIn tlacitko(Button1);
|
|
|
|
int main()
|
|
{
|
|
tlacitko.mode(PullNone);
|
|
|
|
while (true) {
|
|
led1 = 1; led2 = 0; led3 = 0;
|
|
ThisThread::sleep_for(BLINKING_RATE);
|
|
|
|
led1 = 0; led2 = 1; led3 = 0;
|
|
ThisThread::sleep_for(BLINKING_RATE);
|
|
|
|
led1 = 0; led2 = 0; led3 = 1;
|
|
ThisThread::sleep_for(BLINKING_RATE);
|
|
}
|
|
}
|