Sketch working on UNO but not on MKR1000?

It seems you have an old version of the OneWire library installed. Select the library manager in your IDE and update that library.