working terminal toggle of PWM
This commit is contained in:
26
hod1_example_blinky/main.cpp
Normal file
26
hod1_example_blinky/main.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
/* 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
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
// Initialise the digital pin LED1 as an output
|
||||
#ifdef LED1
|
||||
DigitalOut led(LED1);
|
||||
#else
|
||||
bool led;
|
||||
#endif
|
||||
|
||||
while (true) {
|
||||
led = !led;
|
||||
ThisThread::sleep_for(BLINKING_RATE);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user