hw_timer_t *My_timer = NULL;
volatile int counter = 0;
void IRAM_ATTR onTimer400(){
unsigned int mill = millis();
Serial.print("Pada detik (400ms) ke : ");
Serial.print(mill);
Serial.print(" , Counter: ");
Serial.print(counter);
Serial.print("\n");
counter = counter+1;
}
void IRAM_ATTR onTimer600()
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
My_timer = timerBegin(0, 16, true);
timerAttachInterrupt(My_timer, &onTimer400, true);
timerAlarmWrite(My_timer, 1000000, true);
timerAlarmEnable(My_timer);
}
void loop() {
// put your main code here, to run repeatedly:
}