aston aston
/
Nucleo_ticker
而我
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 00003 Ticker toggle_led_ticker; 00004 00005 DigitalOut led1(LED1); 00006 00007 void toggle_led() { 00008 led1 = !led1; 00009 } 00010 00011 int main() { 00012 // Init the ticker with the address of the function (toggle_led) to be attached and the interval (100 ms) 00013 toggle_led_ticker.attach(&toggle_led, 0.1); 00014 while (true) { 00015 // Do other things... 00016 } 00017 }
Generated on Mon Jul 18 2022 20:11:36 by 1.7.2