Nate Napoletano
/
Nucleo_ticker_test
Basic example of how to blink a led using the Ticker object. Test to 1 microsecond.
main.cpp
- Committer:
- bcostm
- Date:
- 2014-12-16
- Revision:
- 0:57e0a19da71e
- Child:
- 2:840d8a34e83f
File content as of revision 0:57e0a19da71e:
#include "mbed.h" Ticker toggle_led_ticker; DigitalOut led1(LED1); void toggle_led() { led1 = !led1; } int main() { // Init the ticker with the address of the function (toggle_led) to be attached and the interval (100 ms) toggle_led_ticker.attach(&toggle_led, 0.1); while (true) { // Do other things... } }