Use Serial.print / Serial.println instead of Serial.write. The Serial Monitor does not understand 0 or 1, only '0' and '1'.