main:
b1 = 2 'Output
b2 = 0 'Port ---- 0 = normal output, 1 = Portc
gosub ramp_up
goto main
ramp_up:
for b0 = 1 to 100
select case b2
case 0
low b1
pauseus 100
high b1
case 1
low portc b1
pauseus 100
high portc b1
end select
next b0
Return
For the port why not use a bit variable, depending on if you need the extra variable space?You won't be able to put 'portc 2' or 'out 2' into the variable just a value like 2 etc. eg: high b1 or high portc b1
Put the value into the variable for the output you want to use then do the gosub, if your mixing normal outputs and portc you might have to set another variable to select which port you want to use.
You can also use the PINS and PINSC for turning outputs on/offCode:main: b1 = 2 'Output b2 = 0 'Port ---- 0 = normal output, 1 = Portc gosub ramp_up goto main ramp_up: for b0 = 1 to 100 select case b2 case 0 low b1 pauseus 100 high b1 case 1 low portc b1 pauseus 100 high portc b1 end select next b0 Return
Could have done that plus others things to squeeze it up tighter but I just tried to make it clear without getting too carried away.For the port why not use a bit variable, depending on if you need the extra variable space?