hw_timer_t * TIMER_0 = NULL; 
hw_timer_t * TIMER_1 = NULL; 
hw_timer_t * TIMER_2 = NULL; 

volatile bool tim_0 = 0; 
volatile bool tim_1 = 0; 
volatile bool tim_2 = 0; 

void IRAM_ATTR func_TIMER_0()
{
  tim_0 = !tim_0; 
}

void IRAM_ATTR func_TIMER_1()
{
  tim_1 = !tim_1; 
}

void IRAM_ATTR func_TIMER_2()
{
  tim_2 = !tim_2; 
}



void setup() {
  TIMER_0 = timerBegin(1000000);
  timerAttachInterrupt(TIMER_0,&func_TIMER_0); 
  timerAlarm(TIMER_0,1000,true,0);
  timerStart(TIMER_0);
   
  TIMER_1 = timerBegin(1000000);
  timerAttachInterrupt(TIMER_1,&func_TIMER_1); 
  timerAlarm(TIMER_1,80,true,0);
  timerStart(TIMER_1); 

  TIMER_2 = timerBegin(1000000);
  timerAttachInterrupt(TIMER_2,&func_TIMER_2); 
  timerAlarm(TIMER_2,40,true,0);
  timerStart(TIMER_2);
  
  Serial.begin(115200); 
}

void loop() {
  Serial.print(tim_0); 
  Serial.print(","); 
  Serial.print(tim_1 + 3);
  Serial.print(","); 
  Serial.println(tim_2 + 6);
  delay(1);
 
}
