xxxx
Dependencies: mbed
LED chaser with a ticker
The easy programm will schow you a ISR routine (InterruptService Routine). The information for the chaser is comming from a array.
B. Schiemann Feb 2018
Revision 0:bc201c33d58f, committed 2018-02-07
- Comitter:
- BSchiemann
- Date:
- Wed Feb 07 14:20:22 2018 +0000
- Commit message:
- Lauflicht with timer ticker
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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Feb 07 14:20:22 2018 +0000 @@ -0,0 +1,20 @@ +#//12a_Laufli_Ticker +#include "mbed.h" + +PortOut laufliPort(PortC, 0x00FF); +Ticker ticker; +const unsigned int laufliValues[] = {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80}; +int state=-1; + +void isr_nextState() +{ + state++; + state=state%8; + laufliPort = laufliValues[state]; +} + +int main() +{ + ticker.attach(&isr_nextState,0.5); + while(1) { } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Feb 07 14:20:22 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/7130f322cb7e \ No newline at end of file