Modify the poll variable to be a byte, and change loop to shift/or the bits into this.
byte poll;
void loop () {
poll = 0 ;
for (count=0; count<=7; count++) {
// select the bit
r0 = bitRead(count,0);
r1 = bitRead(count,1);
r2 = bitRead(count,2);
digitalWrite(2, r0);
digitalWrite(3, r1);
digitalWrite(4, r2);
// read the input pin:
poll <<= 1 ;
poll |= digitalRead(Zin);
}
print1();
}
The string-concatenation operation in the existing code will quickly exhaust the available memory and crash your sketch - never use the String class if you can possibly avoid it, it will bite you hard.