buzzlightyear
Member
I am looking for the most efficient way to achieve the following scenario, and am a bit stumped, I have set up on my 08M2 1 of the pins as inputs, and 4 as outputs, when the input pin is high a count is incremented and the outputs need to respond in the following manner:
(Note this is not code just my way of describing it for my own simplicity, but hopefully you get the idea of what it needs to do, my code is on another computer so I can't post it yet but basically it involves a lot of if <x and >y, and is not fully working anyway, and I want to try and keep it very efficient and small/fast)
if counter = 0 pins = %00010111 pause 40 %00000000
if counter = 6 pins = %00000001 pause 40 %00000000
if counter = 8 pins = %00000100 pause 40 %00000000
if counter = 12 pins = %00000011 pause 40 %00000000
if counter = 16 pins = %00000100 pause 40 %00000000
if counter = 18 pins = %00000001 pause 40 %00000000
if counter = 24 return counter to 0
For all the counter values in between those above pins = %00000000
I'd prefer not to have to do it using lots of "<" and ">" if possible. Thanks.
(Note this is not code just my way of describing it for my own simplicity, but hopefully you get the idea of what it needs to do, my code is on another computer so I can't post it yet but basically it involves a lot of if <x and >y, and is not fully working anyway, and I want to try and keep it very efficient and small/fast)
if counter = 0 pins = %00010111 pause 40 %00000000
if counter = 6 pins = %00000001 pause 40 %00000000
if counter = 8 pins = %00000100 pause 40 %00000000
if counter = 12 pins = %00000011 pause 40 %00000000
if counter = 16 pins = %00000100 pause 40 %00000000
if counter = 18 pins = %00000001 pause 40 %00000000
if counter = 24 return counter to 0
For all the counter values in between those above pins = %00000000
I'd prefer not to have to do it using lots of "<" and ">" if possible. Thanks.