File tree Expand file tree Collapse file tree 8 files changed +32
-56
lines changed Expand file tree Collapse file tree 8 files changed +32
-56
lines changed Original file line number Diff line number Diff line change 3131__version__ = "0.0.0-auto.0"
3232__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git"
3333
34+ import board
3435import adafruit_ht16k33 .segments as segments
35- from adafruit_featherwing import shared
3636from adafruit_featherwing .led_segments import Segments
3737
3838class AlphaNumFeatherWing (Segments ):
3939 """Class representing an `Adafruit 14-segment AlphaNumeric FeatherWing
4040 <https://www.adafruit.com/product/3139>`_.
4141
4242 Automatically uses the feather's I2C bus."""
43- def __init__ (self , address = 0x70 ):
43+ def __init__ (self , address = 0x70 , i2c = None ):
4444 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 )
4648 self ._segments .auto_write = False
Original file line number Diff line number Diff line change 3131__version__ = "0.0.0-auto.0"
3232__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git"
3333
34+ import board
3435import adafruit_ina219
35- from adafruit_featherwing import shared
36-
3736
3837class INA219FeatherWing :
3938 """Class representing an `Adafruit INA219 FeatherWing
4039 <https://www.adafruit.com/product/3650>`_.
4140
4241 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 )
4546
4647 @property
4748 def bus_voltage (self ):
Original file line number Diff line number Diff line change 3131__version__ = "0.0.0-auto.0"
3232__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git"
3333
34+ import board
3435from micropython import const
3536import adafruit_seesaw .seesaw
36- from adafruit_featherwing import shared
3737
3838BUTTON_A = const (1 << 6 )
3939BUTTON_B = const (1 << 7 )
@@ -46,8 +46,10 @@ class JoyFeatherWing:
4646 """Class representing an `Adafruit Joy FeatherWing <https://www.adafruit.com/product/3632>`_.
4747
4848 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 )
5153 self ._seesaw .pin_mode_bulk (BUTTON_A | BUTTON_B | BUTTON_Y | BUTTON_X | BUTTON_SELECT ,
5254 self ._seesaw .INPUT_PULLUP )
5355
Original file line number Diff line number Diff line change 3232__version__ = "0.0.0-auto.0"
3333__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git"
3434
35+ import board
3536import adafruit_ht16k33 .matrix as matrix
36- from adafruit_featherwing import shared
3737
3838class MatrixFeatherWing :
3939 """Class representing an `Adafruit 8x16 LED Matrix FeatherWing
4040 <https://www.adafruit.com/product/3155>`_.
4141
4242 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 )
4547 self ._matrix .auto_write = False
4648 self .columns = 16
4749 self .rows = 8
Original file line number Diff line number Diff line change 3434
3535import time
3636from collections import namedtuple
37+ import board
3738import adafruit_ds3231
38- from adafruit_featherwing import shared
3939
4040class RTCFeatherWing :
4141 """Class representing an `DS3231 Precision RTC FeatherWing
4242 <https://www.adafruit.com/product/3028>`_.
4343
4444 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 )
4749
4850 def __setitem__ (self , index , value ):
4951 """
Original file line number Diff line number Diff line change 3131__version__ = "0.0.0-auto.0"
3232__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git"
3333
34+ import board
3435import adafruit_ht16k33 .segments as segments
35- from adafruit_featherwing import shared
3636from adafruit_featherwing .led_segments import Segments
3737
3838class SevenSegmentFeatherWing (Segments ):
3939 """Class representing an `Adafruit 7-Segment LED HT16K33 FeatherWing
4040 <https://www.adafruit.com/product/3140>`_.
4141
4242 Automatically uses the feather's I2C bus."""
43- def __init__ (self , address = 0x70 ):
43+ def __init__ (self , address = 0x70 , i2c = None ):
4444 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 )
4648 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.
3939 :caption: examples/featherwing_matrix_simpletest.py
4040 :linenos:
4141
42- Other Tests
43- ------------
42+ Other Examples
43+ ---------------
4444
4545.. literalinclude :: ../examples/featherwing_dotstar_palette_example.py
4646 :caption: examples/featherwing_dotstar_palette_example.py
You can’t perform that action at this time.
0 commit comments