The conditional statements below have a pattern, n is multiples of 127 and P2OUT[i] is P2OUT[i-1]*2 + 1.
if n >= 127: P2OUT = 0x01; i