How can I pass a PIN # to a Subroutine? - Possible?
I have a Subroutine like this:
However, I want to be able to pass a different PIN to the SHIFTOUT statement like this:
But·this only works for Bits(??), Bytes, Words, etc.. not PINs.
I get an error: BIT IS NOT A HARDWARE PIN "tmpB1"
Currently I have 4 different PINs that I might send to the subroutine and have to use IF THEN ELSE statements to 4 different Subroutines. I want to reduce this to 1 subroutine if I can find a way to Pass a PIN.
Is this possible (or possibly in a Beta SX/B version)?
SUB send_data1 chunk = ~chunk SHIFTOUT RB.2,RB.0,1,chunk,100 ENDSUB
However, I want to be able to pass a different PIN to the SHIFTOUT statement like this:
send_data1 SUB 1 ClrPos VAR Bit tmpB1 VAR Bit ClrPos = RB.2 SUB send_data1 ClrPos tmpB1 = __PARAM1 chunk = ~chunk SHIFTOUT tmpB1,RB.0,1,chunk,100 ENDSUB
But·this only works for Bits(??), Bytes, Words, etc.. not PINs.
I get an error: BIT IS NOT A HARDWARE PIN "tmpB1"
Currently I have 4 different PINs that I might send to the subroutine and have to use IF THEN ELSE statements to 4 different Subroutines. I want to reduce this to 1 subroutine if I can find a way to Pass a PIN.
Is this possible (or possibly in a Beta SX/B version)?
Comments
http://forums.parallax.com/forums/default.aspx?f=7&m=263425
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College