sorry that wasnt my whole program, just an idea of how it was stuctured.
well time is actually very critical as the paintball marker can fire 35+ balls per second. my program is very long ( just under 4k) because i had to create my own lcd subroutines. when i use the on interupt command, my program becomes very large. i try using the enable and disable commands so that only the top 2 subs are enabled and every thing below is is disabled to intertupt.
i need it to work on edges becuase if i do something like:
loop:
if portb.0 = 1 then
gosub fire
endif
goto loop
the paintball marker will fire in full auto. i could correct this using a variable to hold the state but i was thinking that the interupts would be better.
i now have 2 loops. with out getting to involved, 1 loop is for rising edges, 1 loop is for falling edges. and when the condiotion is met to switch loops, it change the option_reg.6 from 1 to 0.
but,for some wierd (but benifitial to me) reason, when i set the option_reg.6 = 0 it will read both rising and falling tansitions, instead of just falling. which is exacly what i needed.
i need about 1ms reaction time max for my application. my prject is very complex the way it works. my goal is not to make a paintball gun just fire. it is to make it functin a very very specific way. a requirement that is in the tournement handbook.
Bookmarks