Josef Humer
/
BuNuc_1Hz_ticker
Ticker 1Hz, LED blink, basic, Interrupt
Revision 0:803e6b998f11, committed 2019-11-22
- Comitter:
- heseg
- Date:
- Fri Nov 22 14:04:51 2019 +0000
- Commit message:
- Ticker, Interruptfunktion, LED Blink, nucleo F303, HESEG, CAMPUS02
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 803e6b998f11 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Nov 22 14:04:51 2019 +0000 @@ -0,0 +1,23 @@ +/* ********************************************************** */ +/* *************** Projekt: BuNuc_1Hz_Ticker **************** */ +/* BULME Graz, Abteilung Elektronik und Technische Informatik */ +/* ********************************************************** */ + +#include "mbed.h" // Library mbed + +Ticker flipper; // Def. der Tickerfunktion mit Namen flipper +DigitalOut led1(D13); // LED am Port PB_3 + +/* **************** Interruptfunktion **************************** */ +void flip() // Interruptfunktion flip() +{ +led1 = !led1; // Logisches Invertieren des Spannungspegels +} // end void + +/* ******************** Hauptprogramm **************************** */ +int main() +{ +led1 = 1; +flipper.attach(&flip, 0.5); // Interruptaufruf alle 500 ms + while(1); // Endlosschleife +} // end main
diff -r 000000000000 -r 803e6b998f11 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Nov 22 14:04:51 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc \ No newline at end of file