![](/media/cache/group/DffTeam_Yf25WvB.jpg.50x50_q85.jpg)
Esercitazione5_8
Dependencies: mbed
Revision 0:8705ea543a5a, committed 2016-10-31
- Comitter:
- MDevolution
- Date:
- Mon Oct 31 11:12:10 2016 +0000
- Commit message:
- Esercitazione5_8
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 8705ea543a5a main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Oct 31 11:12:10 2016 +0000 @@ -0,0 +1,17 @@ +/* Program Example 8: Simple demo of "Ticker". Replicates behavior of first +led flashing program. +*/ +#include "mbed.h" +void led_switch(void); +Ticker time_up; //define a Ticker, with name “time_up” +DigitalOut myled(LED1); +void led_switch() //the function that Ticker will call +{ + myled=!myled; +} + +int main(){ + time_up.attach(&led_switch, 0.5); //initializes the ticker + while(1) { //sit in a loop doing nothing, waiting for Ticker interrupt + } +} \ No newline at end of file
diff -r 000000000000 -r 8705ea543a5a mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Oct 31 11:12:10 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9bcdf88f62b0 \ No newline at end of file