Trying to modify a driver for a load sense amplifier to work in Micropython. I've gotten rid of the smbus calls replacing them with machine.I2C, but am stuck on the drivers bitshifting operations, which produces incompatible type errors in Micropython
# Mask & set a given bit within a register
def setBit(self, bitNumber, registerAddress): # Mask & set a given bit within a register
value = self.getRegister(registerAddress)
value |= (1 << bitNumber) # Set this bit
return self.setRegister(registerAddress, value)
TypeError: unsupported types for __or__: 'bytes', 'int'
what do I need to do to rework these bitshifting operations so they work in Micropython for my PICO?