NUCLEO-F042K6 Simple demo blinking LED using ticker
Dependencies: mbed
main.cpp
- Committer:
- vodsejak
- Date:
- 2018-02-10
- Revision:
- 0:8eb6644d6308
- Child:
- 1:6428af2e51f5
File content as of revision 0:8eb6644d6308:
#include "mbed.h" /******************************************************************************* EXAMPLE DESCRIPTION Initialize ticker that periodically (100 ms) calls function that toggles onboard LED. *******************************************************************************/ Ticker tick; // Ticker definition DigitalOut LED(LED1); // definition of digital out pin // Toggles LED void toggle_led() { LED = !LED; } int main() { tick.attach(&toggle_led, 0.1); // Init the ticker with the address of the // function (toggle_led) to be attached and // the interval (100 ms) while (true) { // main programm loop - can do other things } }