CommanderLake
Member
I'm using readadc10 with a pot to set 2 variables separately, switching between them with a button, however one must not be greater than the other but I dont want to limit the usable range on the potentiometer.
Code:
readadc10 C.4,w0
if w0!=w1 AND w0!=w2 then
if b12=0 then
w7=w0
w10=w7/4
pokesfr $1B, w10
gosub period
else
w8=w0
>>>scale w8 so 0-1023 fits within 0-w7<<<
pwmduty C.2, w8
gosub duty
endif
w2=w1
w1=w0
endif