File tree Expand file tree Collapse file tree 3 files changed +16
-16
lines changed Expand file tree Collapse file tree 3 files changed +16
-16
lines changed Original file line number Diff line number Diff line change 1010# Uncomment _one_ of the hardware setups below depending on your wiring:
1111
1212# Hardware I2C setup:
13- import nativeio
14- i2c = nativeio .I2C (board .SCL , board .SDA )
13+ import busio
14+ i2c = busio .I2C (board .SCL , board .SDA )
1515lis3dh = adafruit_lis3dh .LIS3DH_I2C (i2c )
1616
1717# Software I2C setup:
2020#lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c)
2121
2222# Hardware SPI setup:
23- #import nativeio
24- #spi = nativeio .SPI(board.SCK, board.MOSI, board.MISO)
25- #cs = nativeio .DigitalInOut(board.D6) # Set to appropriate CS pin!
23+ #import busio
24+ #spi = busio .SPI(board.SCK, board.MOSI, board.MISO)
25+ #cs = busio .DigitalInOut(board.D6) # Set to appropriate CS pin!
2626#lis3dh = adafruit_lis3dh.LIS3DH_SPI(spi, cs)
2727
2828
Original file line number Diff line number Diff line change 1111# Uncomment _one_ of the hardware setups below depending on your wiring:
1212
1313# Hardware I2C setup:
14- import nativeio
15- i2c = nativeio .I2C (board .SCL , board .SDA )
14+ import busio
15+ i2c = busio .I2C (board .SCL , board .SDA )
1616lis3dh = adafruit_lis3dh .LIS3DH_I2C (i2c )
1717
1818# Software I2C setup:
2121#lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c)
2222
2323# Hardware SPI setup:
24- #import nativeio
25- #spi = nativeio .SPI(board.SCK, board.MOSI, board.MISO)
26- #cs = nativeio .DigitalInOut(board.D6) # Set to appropriate CS pin!
24+ #import busio
25+ #spi = busio .SPI(board.SCK, board.MOSI, board.MISO)
26+ #cs = busio .DigitalInOut(board.D6) # Set to appropriate CS pin!
2727#lis3dh = adafruit_lis3dh.LIS3DH_SPI(spi, cs)
2828
2929
Original file line number Diff line number Diff line change 1010# Uncomment _one_ of the hardware setups below depending on your wiring:
1111
1212# Hardware I2C setup:
13- import nativeio
14- i2c = nativeio .I2C (board .SCL , board .SDA )
13+ import busio
14+ i2c = busio .I2C (board .SCL , board .SDA )
1515lis3dh = adafruit_lis3dh .LIS3DH_I2C (i2c )
1616
1717# Software I2C setup:
2020#lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c)
2121
2222# Hardware SPI setup:
23- #import nativeio
24- #spi = nativeio .SPI(board.SCK, board.MOSI, board.MISO)
25- #cs = nativeio .DigitalInOut(board.D6) # Set to appropriate CS pin!
23+ #import busio
24+ #spi = busio .SPI(board.SCK, board.MOSI, board.MISO)
25+ #cs = busio .DigitalInOut(board.D6) # Set to appropriate CS pin!
2626#lis3dh = adafruit_lis3dh.LIS3DH_SPI(spi, cs)
2727
2828
3333# - 0 = Disable click detection.
3434# - 1 = Detect single clicks.
3535# - 2 = Detect single and double clicks.
36- # The second parameter is the threshold and a higher value means less sensitive
36+ # The second parameter is the threshold and a higher value means less sensitive
3737# click detection. Note the threshold should be set based on the range above:
3838# - 2G = 40-80 threshold
3939# - 4G = 20-40 threshold
You can’t perform that action at this time.
0 commit comments