You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (v & 1) {
noInterrupts();
DIRECT_WRITE_LOW(reg, mask);
DIRECT_MODE_OUTPUT(reg, mask); // drive output low
delayMicroseconds(10);
DIRECT_WRITE_HIGH(reg, mask); // --> must be DIRECT_MODE_INPUT to allow it to float
interrupts();
delayMicroseconds(55);
} else {
noInterrupts();
DIRECT_WRITE_LOW(reg, mask);
DIRECT_MODE_OUTPUT(reg, mask); // drive output low
delayMicroseconds(65);
DIRECT_WRITE_HIGH(reg, mask); // --> must be DIRECT_MODE_INPUT to allow it to float
interrupts();
delayMicroseconds(5);
}
}
This way the bus can be 3,3V or 5V.
Best regards
The text was updated successfully, but these errors were encountered:
write_bit has a bug. Actually it writes 5V in the bus when it must allow it float.
void OneWire::write_bit(uint8_t v)
{
IO_REG_TYPE mask IO_REG_MASK_ATTR = bitmask;
volatile IO_REG_TYPE *reg IO_REG_BASE_ATTR = baseReg;
}
This way the bus can be 3,3V or 5V.
Best regards
The text was updated successfully, but these errors were encountered: