arachnidlabs / mcp2210

Python library for interfacing with the MCP2210 USB-SPI interface.
BSD 2-Clause "Simplified" License
26 stars 18 forks source link

TypeError !when i driver MCP2210 in Python window7 #15

Open yifanshu02 opened 7 years ago

yifanshu02 commented 7 years ago

hi,@Arachnid when i driver MCP2210 in Python3.5.2 window7,i encounter a problem:

>>> from mcp2210 import MCP2210
>>> dev = MCP2210(0x04D8,0x00DE)
>>> dev.manufacturer_name = "123"
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    dev.manufacturer_name = "123"
  File "D:\Python35-32\lib\site-packages\mcp2210-0.1.4-py3.5.egg\mcp2210\device.py", line 77, in setter
    self.sendCommand(set_command(value))
  File "D:\Python35-32\lib\site-packages\mcp2210-0.1.4-py3.5.egg\mcp2210\commands.py", line 91, in __init__
    self.string = s
  File "D:\Python35-32\lib\site-packages\mcp2210-0.1.4-py3.5.egg\mcp2210\commands.py", line 100, in string
    self.str[i] = ord(x)
TypeError: ord() expected string of length 1, but int found
>>> 

PS: i have modifyed the code according to @bddap in the "Pull Requests" please give me a hand.