Skip to content

Commit bbba925

Browse files
committed
Move into a module directory
1 parent c732fa7 commit bbba925

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed
File renamed without changes.

adafruit_emc2101_lut.py renamed to adafruit_emc2101/emc2101_lut.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#
33
# SPDX-License-Identifier: MIT
44
"""
5-
`adafruit_emc2101_lut`
5+
`adafruit_emc2101.emc2101_lut`
66
================================================================================
77
8-
Brushless fan controller
8+
Brushless fan controller: extended functionality
99
1010
1111
* Author(s): Bryan Siepert
@@ -24,13 +24,17 @@
2424
2525
# * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
2626
# * Adafruit's Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
27+
28+
The class defined here may be used instead of adafruit_emc2101.EMC2101,
29+
if your device has enough RAM to support it. This class adds LUT control
30+
and PWM frequency control to the base feature set.
2731
"""
2832

2933
from micropython import const
3034
from adafruit_register.i2c_struct import UnaryStruct
3135
from adafruit_register.i2c_bit import RWBit
3236
from adafruit_register.i2c_bits import RWBits
33-
from adafruit_emc2101 import EMC2101
37+
from . import EMC2101
3438

3539
__version__ = "0.0.0-auto.0"
3640
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_EMC2101.git"

examples/emc2101_lut_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
import time
55
import board
66
import busio
7-
from adafruit_emc2101 import EMC2101
7+
from adafruit_emc2101.emc2101_lut import EMC2101_LUT
88

99
i2c = busio.I2C(board.SCL, board.SDA)
1010

1111
FAN_MAX_RPM = 1700
12-
emc = EMC2101(i2c)
12+
emc = EMC2101_LUT(i2c)
1313
emc.manual_fan_speed = 50
1414
time.sleep(1)
1515
emc.lut[27] = 25

examples/set_pwm_freq.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
import time
55
import board
66
import busio
7-
from adafruit_emc2101 import EMC2101
7+
from adafruit_emc2101.emc2101_lut import EMC2101_LUT
88

99
i2c = busio.I2C(board.SCL, board.SDA)
1010

11-
emc = EMC2101(i2c)
11+
emc = EMC2101_LUT(i2c)
1212
emc.set_pwm_clock(use_preset=False)
1313
# Datasheet recommends using the maximum value of 31 (0x1F)
1414
# to provide the highest effective resolution

0 commit comments

Comments
 (0)