Bumblebrain
New Member
Hi, does any one have an idea how to solve the following problem..
Problem is that I have a subroutine in my program..
A01:
Low PORTB.1 : High PORTB.0 : Low PORTB.0
Low PORTB.1 : High PORTB.0 : Low PORTB.0
Low PORTB.1 : High PORTB.0 : Low PORTB.0
Low PORTB.1 : High PORTB.0 : Low PORTB.0
Low PORTB.1 : High PORTB.0 : Low PORTB.0
Low PORTB.1 : High PORTB.0 : Low PORTB.0
Low PORTB.1 : High PORTB.0 : Low PORTB.0
High PORTB.1 : High PORTB.0 : Low PORTB.0
Return
I need to put variables instead of PORTB.1 and PORTB.0 like following
A01:
Low desk : GoSub Enabler
Low desk : GoSub Enabler
Low desk : GoSub Enabler
Low desk : GoSub Enabler
Low desk : GoSub Enabler
Low desk : GoSub Enabler
Low desk : GoSub Enabler
High desk : GoSub Enabler
Return
Also I need to change the variables desk and Enabler. Because sometimes I am using PORTB.1 some times PORTB.4 or PORTB.7.
When I write the following code in the beginning I can not change the varibles again
desk var PORTB.1 <- This is Ok and works well
but when I need to switch to PORTB.4 that is, desk must represent PORTB.4 there is problem..
I could not find a solution.
Basically I need a variable that can be changed any time and represents a specific port in order to use it in my subroutine.
Problem is that I have a subroutine in my program..
A01:
Low PORTB.1 : High PORTB.0 : Low PORTB.0
Low PORTB.1 : High PORTB.0 : Low PORTB.0
Low PORTB.1 : High PORTB.0 : Low PORTB.0
Low PORTB.1 : High PORTB.0 : Low PORTB.0
Low PORTB.1 : High PORTB.0 : Low PORTB.0
Low PORTB.1 : High PORTB.0 : Low PORTB.0
Low PORTB.1 : High PORTB.0 : Low PORTB.0
High PORTB.1 : High PORTB.0 : Low PORTB.0
Return
I need to put variables instead of PORTB.1 and PORTB.0 like following
A01:
Low desk : GoSub Enabler
Low desk : GoSub Enabler
Low desk : GoSub Enabler
Low desk : GoSub Enabler
Low desk : GoSub Enabler
Low desk : GoSub Enabler
Low desk : GoSub Enabler
High desk : GoSub Enabler
Return
Also I need to change the variables desk and Enabler. Because sometimes I am using PORTB.1 some times PORTB.4 or PORTB.7.
When I write the following code in the beginning I can not change the varibles again
desk var PORTB.1 <- This is Ok and works well
but when I need to switch to PORTB.4 that is, desk must represent PORTB.4 there is problem..
I could not find a solution.
Basically I need a variable that can be changed any time and represents a specific port in order to use it in my subroutine.