short program to show a problem with spi and tickers

Dependencies:   mbed

pattern.cpp

Committer:
sravet
Date:
2010-10-20
Revision:
0:85d990bd01f4

File content as of revision 0:85d990bd01f4:

#include "mbed.h"
#include "pattern.h"


DigitalOut led1(LED1);  //rotate_leds
DigitalOut led2(LED2);  //HSV2RGB
DigitalOut led3(LED3);
DigitalOut led4(LED4);
AnalogOut aout(p18);

// pattern constructor.  Turn off LEDs, initialize class variables.
pattern::pattern()
{
}


// start up the pattern ticker.  Keep track of rotation and throb counters and update
// the LEDs when necessary.
void pattern::start(void)
{
  update_ticker.attach_us(this,&pattern::update_isr,1000000/ISR_FREQ);
}




void pattern::update_isr()
{
  led4=1;
  led4=0;
  led4=1;
  wait_us(2);
  led4=0;
}