9,17 → 9,17 |
Output_low(LED2); |
} |
|
#int_RB |
/*#int_RB |
void RB_isr(void) |
{ |
output_high(LED2); |
output_toggle(PIN_B2); |
input_b(); |
} |
output_high(LED2); |
}*/ |
|
|
void main() |
{ |
unsigned int8 last; |
|
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
setup_adc(ADC_OFF); |
setup_psp(PSP_DISABLED); |
32,16 → 32,18 |
setup_comparator(NC_NC_NC_NC); |
setup_vref(FALSE); |
|
set_tris_b(0xFF); |
port_b_pullups(TRUE); |
|
enable_interrupts(INT_TIMER0); |
enable_interrupts(INT_RB); |
// enable_interrupts(INT_RB); |
enable_interrupts(GLOBAL); |
|
last=input_b(); |
|
while(true) |
{ |
Output_toggle(LED1); |
Delay_ms(100); |
if(last!=Input_b()) output_high(LED2); |
last=input_b(); |
} |
} |