Can you explain a bit more about the code you uploaded.
Is it the main program or is it the interrupt portion?
For ALL newbies, it is good if you can format the layout of your program so that it is easy to read through - you will find if it is easier to read then others can understand it better and are more will ing to help you.
I have done that here but am not really sure what I am look at to help further. Can I suggest you upload your formatted complete program.
I also try and use a scheme for typing programs as follows:
1. Labels start with a capital (all other letters lower case) in the fist column
2. The rest of the program is indented by 8 or 10 spaces (not TABs) (see example below)
3. the inner part of loops FOR..NEXT, DO,.. WHILE etc are indented by a further 2 spaces to identify the loop structure better
4. variables all in lower case
5. all BASIC keywords/commands completely in CAPITALS
Code:
Setfreq m8
rapidoff: Low 1
do
if pin3 = 1 then pause1
loop while pin3 = 0
goto rapidoff
pause1: pause 1000
goto rapidon ; this is unnecessary as it will automatically drop through to the label rapidon:
rapidon: Low 1
High 1
Readadc 4,b0
If b0 > 80 then Rapidfire1
If pin3 = 1 then pause2
goto rapidon
Rapidfire1: Do
High 1
High 4
Pause 120
Low 4
Low 1
Pause 115
b0=b0 and %00000000
Let dirs=b0
Readadc 4, b0
Loop while b0 > 80
goto rapidon
pause2: pause 1000
goto rapidon2 ; this is unnecessary as it will automatically drop through to the label rapidon2:
rapidon2: Low 1
High 1
Readadc 4,b0
If b0 > 80 then Rapidfire2
If pin3 = 1 then pause3
goto rapidon2
Rapidfire2: Do
High 4
Pause 80
Low 4
Pause 75
b0=b0 and %00000000
Let dirs=b0
Readadc 4, b0
Loop while b0 > 80
goto rapidon2
pause3: pause 1000
goto rapidon3 ; this line not necessary
rapidon3: Low 1
High 1
Readadc 4,b0
If b0 > 80 then Rapidfire3
If pin3 = 1 then pause4
goto rapidon3
pause4: pause 1000
goto rapidoff
Rapidfire3: Do
High 1
Low 4
Pause 80
High 4
Pause 80
Low 4
Pause 80
High 4
Pause 80
Low 4
Pause 80
High 4
Pause 80
Low 4
Pause 80
High 4
Pause 500
b0=b0 and %00000000
Let dirs=b0
Readadc 4, b0
Loop while b0 > 80
goto rapidon3