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

main.cpp

Committer:
BSchiemann
Date:
2018-02-07
Revision:
0:bc201c33d58f

File content as of revision 0:bc201c33d58f:

#//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) {   }
}