All pastes #771037 Raw Edit

Something

public c v1 · immutable
·published 2007-11-12 19:37 UTC
rendered paste body
#include <avr/io.h>#include <avr/interrupt.h>int state1;int state2;SIGNAL(SIG_INTERRUPT0){        if ((PINA & (1<<PA0))==0) {                if(state1==0){                        PORTD |=(1<<PD6);                        state1=1;                }        }        else if ((PINA & (1<<PA0))==1){                if(state1==1){                        PORTD &=~(1<<PD6);                        state1=0;                }        }        else if ((PINA & (1<<PA1))==0) {                if(state2==0){                        PORTD |=(1<<PD5);                        state2=1;                }        } else if ((PINA & (1<<PA1))==1) {                if(state2==1){                        PORTD &=~(1<<PD5);                        state2=0;                }        }}int main(void){        state1 = 1;        state2=1;        GICR=0xC0;        MCUCR=0x01;        sei();        DDRD |= (1 << PD6);        DDRD |= (1 << PD5);        PORTD |= (1 << PD2);        PORTA |= (1 << PA0);        PORTA |= (1 << PA1);        while (1) {        }        return 0;}