adafruit / Adafruit_CircuitPython_EMC2101

CircuitPython driver for EMC2101 brushless fan controller
MIT License
3 stars 9 forks source link

Slim lut #7

Closed rpavlik closed 3 years ago

rpavlik commented 3 years ago

Ready to go now, depends on #9 and #6 .

This reduces memory usage, when running on a CPB from .py (not .mpy) by 1328 bytes, so that's something :) I also have a bunch of docs improvements in here too.

rpavlik commented 3 years ago

Specifically here's the error on the cpb:

code.py output:
Traceback (most recent call last):
  File "code.py", line 17, in <module>
  File "/lib/adafruit_emc2101_new/emc2101_lut.py", line 81, in __setitem__
  File "/lib/adafruit_emc2101_new/emc2101_lut.py", line 134, in _set_lut
  File "adafruit_register/i2c_struct.py", line 48, in __set__
  File "adafruit_register/i2c_struct.py", line 48, in __set__
  File "adafruit_bus_device/i2c_device.py", line 84, in write
OSError: [Errno 5] Input/output error

Thoughts on what I'm doing wrong?

rpavlik commented 3 years ago

Turns out this chip only likes 1-byte reads and writes. Ready for review.