BS1 - Assigning a value to a variable based upon multiple pin states
Hello Everyone. I've backed up to using a BS1 for a project, and has been years since I've used one. I have my code about finished, but need advise on a simple way to monitor the state of 4 input pins (P4,P5,P6,P7) which will be either HIGH or LOW and assign a value to a variable called DELAY based upon the pins states or combination of states.
BS1, PBasic 1.0
I need to not only check the state of each pin, but several combinations as follows:
P4,P5,P6,P7 normally LOW
P4 HIGH assign number 1 to DELAY
P5 HIGH assign number 2 to DELAY
P6 HIGH assign number 3 to DELAY
P7 HIGH assign number 4 to DELAY
P4 & P5 HIGH assign number 5 to DELAY
P4 & P6 HIGH assign number 6 to DELAY
P4 & P7 HIGH assign number 7 to DELAY
Suggestions on an easy way to do this would be appreciated. Thanks.
BS1, PBasic 1.0
I need to not only check the state of each pin, but several combinations as follows:
P4,P5,P6,P7 normally LOW
P4 HIGH assign number 1 to DELAY
P5 HIGH assign number 2 to DELAY
P6 HIGH assign number 3 to DELAY
P7 HIGH assign number 4 to DELAY
P4 & P5 HIGH assign number 5 to DELAY
P4 & P6 HIGH assign number 6 to DELAY
P4 & P7 HIGH assign number 7 to DELAY
Suggestions on an easy way to do this would be appreciated. Thanks.
Comments
now you can finish it