Set slide potentiometer values
analogRead() returns 0x0000 to 0x03ff

If the max data 0x03ff is shifted to the right by 3 bits (or divide by 8), 
then 0x03ff becomes 0x007f, or 127.

I think this will do it:

desiredMax = analogRead(A0) &gt;&gt; 3; // divide 1023 max by 8, becomes 127 max