Counter

Aus Ethersex_Wiki
Wechseln zu: Navigation, Suche


Impuls Counter mittels Control6 Script


Signal eingang am INT0 pin


<source lang="text"> CONTROL_START

       ECMD_GLOBAL(pc_counter, 0);
       ON STARTUP DO
               //      GICR |= _BV(INT0);              // ATMEGA32
               //      MCUCR |= _BV(ISC01);            // ATMEGA32
               EIMSK |= _BV(PCINT0);           // ATMEGA644
               EICRA |= _BV(ISC01);            // ATMEGA644
       END

CONTROL_END

ISR(INT0_vect) {

       pc_counter ++;

} </script>