File tree 8 files changed +32
-56
lines changed
8 files changed +32
-56
lines changed Original file line number Diff line number Diff line change 31
31
__version__ = "0.0.0-auto.0"
32
32
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git"
33
33
34
+ import board
34
35
import adafruit_ht16k33 .segments as segments
35
- from adafruit_featherwing import shared
36
36
from adafruit_featherwing .led_segments import Segments
37
37
38
38
class AlphaNumFeatherWing (Segments ):
39
39
"""Class representing an `Adafruit 14-segment AlphaNumeric FeatherWing
40
40
<https://www.adafruit.com/product/3139>`_.
41
41
42
42
Automatically uses the feather's I2C bus."""
43
- def __init__ (self , address = 0x70 ):
43
+ def __init__ (self , address = 0x70 , i2c = None ):
44
44
super ().__init__ ()
45
- self ._segments = segments .Seg14x4 (shared .I2C_BUS , address )
45
+ if i2c is None :
46
+ i2c = board .I2C ()
47
+ self ._segments = segments .Seg14x4 (i2c , address )
46
48
self ._segments .auto_write = False
Original file line number Diff line number Diff line change 31
31
__version__ = "0.0.0-auto.0"
32
32
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git"
33
33
34
+ import board
34
35
import adafruit_ina219
35
- from adafruit_featherwing import shared
36
-
37
36
38
37
class INA219FeatherWing :
39
38
"""Class representing an `Adafruit INA219 FeatherWing
40
39
<https://www.adafruit.com/product/3650>`_.
41
40
42
41
Automatically uses the feather's I2C bus."""
43
- def __init__ (self ):
44
- self ._ina219 = adafruit_ina219 .INA219 (shared .I2C_BUS )
42
+ def __init__ (self , i2c = None ):
43
+ if i2c is None :
44
+ i2c = board .I2C ()
45
+ self ._ina219 = adafruit_ina219 .INA219 (i2c )
45
46
46
47
@property
47
48
def bus_voltage (self ):
Original file line number Diff line number Diff line change 31
31
__version__ = "0.0.0-auto.0"
32
32
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git"
33
33
34
+ import board
34
35
from micropython import const
35
36
import adafruit_seesaw .seesaw
36
- from adafruit_featherwing import shared
37
37
38
38
BUTTON_A = const (1 << 6 )
39
39
BUTTON_B = const (1 << 7 )
@@ -46,8 +46,10 @@ class JoyFeatherWing:
46
46
"""Class representing an `Adafruit Joy FeatherWing <https://www.adafruit.com/product/3632>`_.
47
47
48
48
Automatically uses the feather's I2C bus."""
49
- def __init__ (self ):
50
- self ._seesaw = adafruit_seesaw .seesaw .Seesaw (shared .I2C_BUS )
49
+ def __init__ (self , i2c = None ):
50
+ if i2c is None :
51
+ i2c = board .I2C ()
52
+ self ._seesaw = adafruit_seesaw .seesaw .Seesaw (i2c )
51
53
self ._seesaw .pin_mode_bulk (BUTTON_A | BUTTON_B | BUTTON_Y | BUTTON_X | BUTTON_SELECT ,
52
54
self ._seesaw .INPUT_PULLUP )
53
55
Original file line number Diff line number Diff line change 32
32
__version__ = "0.0.0-auto.0"
33
33
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git"
34
34
35
+ import board
35
36
import adafruit_ht16k33 .matrix as matrix
36
- from adafruit_featherwing import shared
37
37
38
38
class MatrixFeatherWing :
39
39
"""Class representing an `Adafruit 8x16 LED Matrix FeatherWing
40
40
<https://www.adafruit.com/product/3155>`_.
41
41
42
42
Automatically uses the feather's I2C bus."""
43
- def __init__ (self , address = 0x70 ):
44
- self ._matrix = matrix .Matrix16x8 (shared .I2C_BUS , address )
43
+ def __init__ (self , address = 0x70 , i2c = None ):
44
+ if i2c is None :
45
+ i2c = board .I2C ()
46
+ self ._matrix = matrix .Matrix16x8 (i2c , address )
45
47
self ._matrix .auto_write = False
46
48
self .columns = 16
47
49
self .rows = 8
Original file line number Diff line number Diff line change 34
34
35
35
import time
36
36
from collections import namedtuple
37
+ import board
37
38
import adafruit_ds3231
38
- from adafruit_featherwing import shared
39
39
40
40
class RTCFeatherWing :
41
41
"""Class representing an `DS3231 Precision RTC FeatherWing
42
42
<https://www.adafruit.com/product/3028>`_.
43
43
44
44
Automatically uses the feather's I2C bus."""
45
- def __init__ (self ):
46
- self ._rtc = adafruit_ds3231 .DS3231 (shared .I2C_BUS )
45
+ def __init__ (self , i2c = None ):
46
+ if i2c is None :
47
+ i2c = board .I2C ()
48
+ self ._rtc = adafruit_ds3231 .DS3231 (i2c )
47
49
48
50
def __setitem__ (self , index , value ):
49
51
"""
Original file line number Diff line number Diff line change 31
31
__version__ = "0.0.0-auto.0"
32
32
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git"
33
33
34
+ import board
34
35
import adafruit_ht16k33 .segments as segments
35
- from adafruit_featherwing import shared
36
36
from adafruit_featherwing .led_segments import Segments
37
37
38
38
class SevenSegmentFeatherWing (Segments ):
39
39
"""Class representing an `Adafruit 7-Segment LED HT16K33 FeatherWing
40
40
<https://www.adafruit.com/product/3140>`_.
41
41
42
42
Automatically uses the feather's I2C bus."""
43
- def __init__ (self , address = 0x70 ):
43
+ def __init__ (self , address = 0x70 , i2c = None ):
44
44
super ().__init__ ()
45
- self ._segments = segments .Seg7x4 (shared .I2C_BUS , address )
45
+ if i2c is None :
46
+ i2c = board .I2C ()
47
+ self ._segments = segments .Seg7x4 (i2c , address )
46
48
self ._segments .auto_write = False
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ Ensure your device works with this simple test.
39
39
:caption: examples/featherwing_matrix_simpletest.py
40
40
:linenos:
41
41
42
- Other Tests
43
- ------------
42
+ Other Examples
43
+ ---------------
44
44
45
45
.. literalinclude :: ../examples/featherwing_dotstar_palette_example.py
46
46
:caption: examples/featherwing_dotstar_palette_example.py
You can’t perform that action at this time.
0 commit comments