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
Diff: main.cpp
- Revision:
- 0:bc201c33d58f
--- /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) { } +}