Dear all,
While working on the OLED project, I'm implementing a radio-button-like feature - the user should be able to select ONE out of a number of options. In practical terms, this means if one value of an array is set, all others should be cleared. While there are three options to choose from, one can get away with something like the case statement matrix below. If you have 10 options, however, this alone will take 25% of your program memory .
Is there a better way?
Thank you all for your time,
Edmunds
While working on the OLED project, I'm implementing a radio-button-like feature - the user should be able to select ONE out of a number of options. In practical terms, this means if one value of an array is set, all others should be cleared. While there are three options to choose from, one can get away with something like the case statement matrix below. If you have 10 options, however, this alone will take 25% of your program memory .
Code:
UpdateBit:
Symbol TLMode = b17
Symbol BitNumber = b18
togglebit TLMode, BitNumber
Select case BitNumber
case 0 : Clearbit TLMode, 1 : Clearbit TLMode, 2
case 1 : Clearbit TLMode, 0 : Clearbit TLMode, 2
case 2 : Clearbit TLMode, 0 : Clearbit TLMode, 1
endselect
return
Thank you all for your time,
Edmunds