Would this be feasible?
IOUT = POT.lowbyte
IOUT must only be changed by push button increments and decrements. If they are made equal any change made to POT.lowbyte would change IOUT. How do I get this to work one way only?
Would this be feasible?
IOUT = POT.lowbyte
IOUT must only be changed by push button increments and decrements. If they are made equal any change made to POT.lowbyte would change IOUT. How do I get this to work one way only?
Not clear to me what you want.
You say
and/orIOUT must only be changed by push button increments and decrements.
???any change made to POT.lowbyte would change IOUT
Which way do you want??How do I get this to work one way only?
Dave
Always wear safety glasses while programming.
IOUT gets changed with a pushbutton input, either increased or decreased. I need to display that value on an LCD and also send that value out to a digital pot.
I need to make sure that IOUT is only changed with the pressing of the pushbuttons, and I also need to make sure POT.lowbyte is always the same as IOUT.
POT is 16bit and I wanted to know if I could load the 8 bit IOUT into POT.lowbyte.
Maybe something like this
Code:POT_ROUTINE: IF BUTT1 =1 THEN IOUT = 1 IF BUTT2 = 1 THEN IOUT = 0 POT = IOUT RETURN
Dave
Always wear safety glasses while programming.
You're going to have issues with a variable named POT since this is a PBP command, and reserved, but if you just want to alias the low byte in a word var, then use something like this;
ADPOT VAR WORD
IOUT VAR ADPOT.BYTE0 ' this is just an alias to the low byte in ADPOT.
Any value you place in IOUT will be placed in ADPOT.LOWBYTE. And whatever value is in ADPOT.LOWBYTE will also be in IOUT since it's the same RAM address as the low byte in ADPOT . It's in the manual...;o)
Bookmarks