mbed ledky2
This commit is contained in:
31
mbed_ledky2/main.cpp
Normal file
31
mbed_ledky2/main.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
/* 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user