The OneWire library uses direct register access. You can see it for the different boards here: https://github.com/PaulStoffregen/OneWire/blob/master/util/OneWire_direct_gpio.h.
With direct register access, a Arduino Uno could drive a small motor without extra hardware. Read the "README.md" tab in this Wokwi project: https://wokwi.com/arduino/projects/309655684318757441
A digitalWrite() for a Arduino Uno is about 5ms 5µs, that is 5000ns.
Changing a output pin with direct register access is 125ns.
The instruction set of the ATmega328P microcontroller (used in the Arduino Uno) is designed to change a output pin very fast.
@filmchaser, the code PINB |= 0b00000000; is a bug. That single line of code is indeed amazingly stupid as Coding_Badly wrote in reply #4.
[EDIT] Changed 5ms to 5µs. Oops ![]()