// Hardware Timer sketch 3: Using split timers

void onRed() {    ledOn(BODY_RGB_RED_PIN); }       
void onGreen() {  ledOn(BODY_RGB_GREEN_PIN); }       
void offRed() {   ledOff(BODY_RGB_RED_PIN); }       
void offGreen() { ledOff(BODY_RGB_GREEN_PIN); }       

void setup() {
  Timer1.begin();               // 1KHz tick, 1Hz lap 
  Timer1.setSplitHandler(3,100,onRed);   // Split 3: At 100ms, turn on red
  Timer1.setSplitHandler(1,600,offRed);  // Split 1: At 600ms, turn off red
  Timer1.setSplitHandler(2,400,onGreen); // Split 2: At 400ms, turn on green
  Timer1.setLapHandler(offGreen);        // At the lap, turn off green
  Timer1.start();               // And start the timer
}

void loop() { }

