Please help me to get out of interrupts when you press the button invertion PORTB, 1. Here is my code:
Code: Select all
program TMR0
Dim i as byte
sub procedure start
nop
end sub
sub procedure interrupt
if Button(PORTB, 0, 5, 1) then
SetBit(PORTB, 7)
delay_ms(5000)
ClearBit(PORTB, 7)
for i = 0 to 4
Sound_Play(880, 1000)
delay_ms(1000)
next i
else if Button(PORTB, 1, 5, 1) then
goto start
end if
ClearBit(INTCON, 2)
INTCON = 0xA0
end sub
main:
TRISB = 0x01
PORTB = 0x00
INTCON = 0xA0
OPTION_REG = %11000101
TMR0 = 0x00
Sound_Init(PORTE, 1)
nop
nop
start:
goto start
end.
If pressed invertion PORTB,0, enables invertion PORTB,7 for 5 seconds. If at this time was pressed invertion PORTB,1, the time delay stops and again are state of buttons
The compiler gives lots of errors, I can not understand, although previously programmed in VB6/VB.NET