#include #pragma config FOSC=HS, WDT=OFF, LVP=OFF, PBADEN=OFF void main() { ADCON1 = 0x0F; INTCON2bits.RBPU = 1; //NON abilita le resistenze di pull-up porta B LATA=0; TRISA=0; LATB=0; TRISB=0; LATC=0; TRISC=0; LATD=0; TRISD=0; LATE=0; TRISE=0; TRISBbits.TRISB2 = 1; //RB2-INT2 input //LATD = 0b10101010; while(1) { LATDbits.LATD0 = PORTBbits.RB2; } }