Python codes on Github Native I2C


Is it correct to think that the python codes that are coming alone on github with various of sensors can be used only with native I2C ports?

I want to test the HYT939 sensor with the python code on github using a raspberry pi, a usb to i2c converter and then using pyton to work with it.

So first there is the import smbus: I assume this for accessing the I2C bus.
But when changing this to import serial, and make a COM connection, the write data, is still in I2C i think. Correct?

HYT939 address, 0x28(40)

0x80(128) Send normal mode

bus.write_byte(0x28, 0x80)

I change bus.write to port.write, but then i get this error:

TypeError: write() takes exactly 2 arguments (3 given)

Sorry if it al sounds very strange, or not logical at all. I’m still new at this… :slight_smile: