Page 1 of 1

POT skip routines

Posted: Wed May 05, 2021 7:56 am
by ZibiSound
Hello,
I found in "coding examples" code, that allows change pot into multiposition switch. The problem is with bit mask - it could be 2, 4, 8, 16, etc.
Is there any option to make it 11 positions? Eg, position 1: pot 0-0.09, position 2: pot 0.1-0.19, ... , position 11: pot > 0.99

Re: POT skip routines

Posted: Wed May 05, 2021 11:59 am
by frank
No quick trick that I am aware of, you will need to do something like subtract 1/11 and if negative then jump if not then subtract an additional 1/11 and if negative then jump, and so on. But that will use about 22 instructions just for that.

Re: POT skip routines

Posted: Wed May 05, 2021 12:30 pm
by ZibiSound
Okay, that could be good enought.
Thank you, Sir.