Closed JACKAR710 closed 9 months ago
void f(){
TCCR0A = (1<<WGM01);
OCR0A = 0xC8;
TIMSK0 |= (1 << OCIE0A);
TCCR0B |= (1 << CS02);
}
ISR (TIMER0_COMPA_vect) { //TIMER 1 SECOND
timer_count++;
if(timer_count==156) { //DO SOMETHING EVERY SECOND
lamp_timeout++;
motor_timeout++;
pir_timer++;
led_timeout++;
if(current_error==1){
}
timer_count=0;
}
}
dir kan evt gebruikt worden als de juiste timer geselectteerd word en de juiste prescalar
Millis library die het aantal milliseconden aan runtime returned