Counter

Aus Ethersex_Wiki
Wechseln zu: Navigation, Suche


Impuls Counter mittels Control6 Script


Signal eingang am INT0 pin
Counter Abfrage mittels ECMD:

gummi:~# echo "c6 get pc_counter" | socat stdio tcp4:10.0.0.40:2701
pc_counter 98



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 ++;
}