Use the constructor without parameter `OneWire wire;` and call `wire.begin(pin);` to set the pin.