It's done here:


data1[i] = analog1[i].getValue()>>3;

The ">>3" means to shift the bits by 3 positions, which is a very efficient way to divide by 8.