def _set_command_value(self, cmd, value, cmd_delay=0):
self._buffer[0] = (cmd >> 8) & 0xFF
self._buffer[1] = cmd & 0xFF
self._crc_buffer[0] = self._buffer[2] = (value >> 8) & 0xFF
self._crc_buffer[1] = self._buffer[3] = value & 0xFF
self._buffer[4] = self._crc8(self._crc_buffer)
self.i2c_device.i2c.write(self.address, self._buffer) # error in this line 'AttributeError: 'I2C' object has no attribute 'i2c'
when I remove the second i2c tag in this line I get - "TypeError: function takes 2 positional arguments but 3 were given" - When commenting out this line, rest of code runs fine.
time.sleep(cmd_delay)
Any Ideas of what has gone wrong?
I am having a problem with this section of code:
when I remove the second i2c tag in this line I get - "TypeError: function takes 2 positional arguments but 3 were given" - When commenting out this line, rest of code runs fine. time.sleep(cmd_delay) Any Ideas of what has gone wrong?
_Originally posted by @bocephasj in https://github.com/peter-l5/MicroPython_SCD4X/issues/3#issuecomment-1646874714_