Hello,
I am a beginner and want to address NCD devices with a “USB to I2C Converter with Virtual COM Port FT230XSNCD Sensor”.
You write about it:
“Plug in our USB to I2C converter into any available USB port on your PC and it mounts as a COM port, start sending commands at 115.2K Baud.”
My question:
Is there any tutorial which commands are available?
Maybe you can tell me where I can find some help.
To talk to a particular I2C sensor or controller you’ll need to check the resources of that sensor to know what commands it expects over I2C and send that over serial wrapped in the NCD API outlined in the above resources.
Hi Jacob,
Thanks for your help!
I’ve been to the Resources page and had read a lot of stuff there - except the “Serial to I2C Conversion”. That was my mistake.
Thanks a lot!
No problem. I haven’t written a library specifically for the USB to I2C converter, but that wrapper API we use for a lot of things. I generally create an API wrapper function/method I can pass raw commands to so I don’t have to enter header bytes and calculate checksums when I define functionality.
Example API wrapper in Python:
def wrap_in_api(self, data):
bytes_in_packet = len(data)
data.insert(0, bytes_in_packet)
data.insert(0, 170)
data = self.add_checksum(data)
return data
def add_checksum(self, data):
data.append(int(sum(data) & 255))
return data
command = wrap_in_api([254, 140, 1, 1])