Added commented out board.stemma_i2c()
This commit is contained in:
parent
36a27be58c
commit
ec9caa6af5
20 changed files with 51 additions and 21 deletions
|
|
@ -34,8 +34,10 @@ led = digitalio.DigitalInOut(board.LED)
|
|||
led.switch_to_output()
|
||||
|
||||
# Set up the BME280 and LC709203 sensors
|
||||
bme280 = adafruit_bme280.Adafruit_BME280_I2C(board.I2C())
|
||||
battery_monitor = LC709203F(board.I2C())
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)
|
||||
battery_monitor = LC709203F(i2c)
|
||||
battery_monitor.pack_size = battery_pack_size
|
||||
|
||||
# Collect the sensor data values and format the data
|
||||
|
|
|
|||
|
|
@ -9,9 +9,10 @@ from adafruit_bme280 import basic as adafruit_bme280
|
|||
from adafruit_lc709203f import LC709203F, PackSize
|
||||
|
||||
# Create sensor objects, using the board's default I2C bus.
|
||||
i2c = board.I2C()
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)
|
||||
battery_monitor = LC709203F(board.I2C())
|
||||
battery_monitor = LC709203F(i2c)
|
||||
battery_monitor.pack_size = PackSize.MAH400
|
||||
|
||||
# change this to match your location's pressure (hPa) at sea level
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ import adafruit_lis3mdl
|
|||
import adafruit_lsm6ds.lsm6ds33
|
||||
import adafruit_sht31d
|
||||
|
||||
i2c = board.I2C()
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
|
||||
apds9960 = adafruit_apds9960.apds9960.APDS9960(i2c)
|
||||
bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@ led = digitalio.DigitalInOut(board.LED)
|
|||
led.switch_to_output()
|
||||
|
||||
# Set up the LC709203 sensor
|
||||
battery_monitor = LC709203F(board.I2C())
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
battery_monitor = LC709203F(i2c)
|
||||
battery_monitor.pack_size = battery_pack_size
|
||||
|
||||
# Collect the sensor data values and format the data
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@ import board
|
|||
from adafruit_lc709203f import LC709203F, PackSize
|
||||
|
||||
# Create sensor object, using the board's default I2C bus.
|
||||
battery_monitor = LC709203F(board.I2C())
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
battery_monitor = LC709203F(i2c)
|
||||
|
||||
# Update to match the mAh of your battery for more accurate readings.
|
||||
# Can be MAH100, MAH200, MAH400, MAH500, MAH1000, MAH2000, MAH3000.
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ main_group.append(text_area)
|
|||
print("LC709203F test")
|
||||
print("Make sure LiPoly battery is plugged into the board!")
|
||||
|
||||
sensor = LC709203F(board.I2C())
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
sensor = LC709203F(i2c)
|
||||
|
||||
print("IC version:", hex(sensor.ic_version))
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,8 @@ power_pin = DigitalInOut(board.D3)
|
|||
power_pin.switch_to_output()
|
||||
|
||||
# Set up the light sensor
|
||||
i2c = board.I2C()
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
sensor = adafruit_bh1750.BH1750(i2c)
|
||||
|
||||
### Feeds ###
|
||||
|
|
|
|||
|
|
@ -10,7 +10,9 @@ from adafruit_seesaw.analoginput import AnalogInput
|
|||
from adafruit_seesaw import neopixel
|
||||
|
||||
# NeoSlider Setup
|
||||
neoslider = Seesaw(board.I2C(), 0x30)
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
neoslider = Seesaw(i2c, 0x30)
|
||||
potentiometer = AnalogInput(neoslider, 18)
|
||||
pixels = neopixel.NeoPixel(neoslider, 14, 4, pixel_order=neopixel.GRB)
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,9 @@ import board
|
|||
import neopixel
|
||||
from adafruit_apds9960.apds9960 import APDS9960
|
||||
|
||||
apds = APDS9960(board.I2C())
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
apds = APDS9960(i2c)
|
||||
pixels = neopixel.NeoPixel(board.NEOPIXEL, 2)
|
||||
|
||||
apds.enable_proximity = True
|
||||
|
|
|
|||
|
|
@ -14,7 +14,9 @@ from adafruit_hid.keycode import Keycode
|
|||
import neopixel
|
||||
from adafruit_apds9960.apds9960 import APDS9960
|
||||
|
||||
apds = APDS9960(board.I2C())
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
apds = APDS9960(i2c)
|
||||
pixels = neopixel.NeoPixel(board.NEOPIXEL, 2)
|
||||
keyboard = Keyboard(usb_hid.devices)
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,9 @@ from adafruit_midi.pitch_bend import PitchBend
|
|||
|
||||
from adafruit_apds9960.apds9960 import APDS9960
|
||||
|
||||
apds = APDS9960(board.I2C())
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
apds = APDS9960(i2c)
|
||||
apds.enable_proximity = True
|
||||
|
||||
touch1 = touchio.TouchIn(board.TOUCH1)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@ from adafruit_ble.services.standard.hid import HIDService
|
|||
from adafruit_ble.services.standard.device_info import DeviceInfoService
|
||||
|
||||
# setup I2C
|
||||
i2c = board.I2C()
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
|
||||
# setup accelerometer
|
||||
lsm6ds33 = adafruit_lsm6ds.lsm6ds33.LSM6DS33(i2c)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ blue_led.value = False
|
|||
max_rate = 180
|
||||
|
||||
# Seven Segment FeatherWing setup
|
||||
i2c = board.I2C()
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
display_A = Seg7x4(i2c, address=0x70) # this will be the BPM display
|
||||
display_A.fill(0) # Clear the display
|
||||
# Second display has A0 address jumpered
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ import adafruit_sht31d # humidity sensor
|
|||
import adafruit_bmp280 # barometric sensor
|
||||
import adafruit_lis3mdl # magnetic sensor
|
||||
|
||||
i2c = board.I2C()
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
|
||||
sense_accel = adafruit_lsm6ds.LSM6DS33(i2c)
|
||||
sense_humid = adafruit_sht31d.SHT31D(i2c)
|
||||
|
|
|
|||
|
|
@ -71,7 +71,8 @@ audio = audioio.AudioOut(board.A0) # Speaker
|
|||
wave_file = None
|
||||
|
||||
# Set up accelerometer on I2C bus, 4G range:
|
||||
i2c = board.I2C()
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
accel = adafruit_lis3dh.LIS3DH_I2C(i2c)
|
||||
accel.range = adafruit_lis3dh.RANGE_4_G
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,9 @@ splash.append(text_group)
|
|||
board.DISPLAY.show(splash)
|
||||
|
||||
# connect to the accelerometer
|
||||
sensor = LSM6DS33(board.I2C())
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
sensor = LSM6DS33(i2c)
|
||||
# highest range for impacts!
|
||||
sensor.accelerometer_range = AccelRange.RANGE_16G
|
||||
# we'll read at about 1KHz
|
||||
|
|
|
|||
|
|
@ -57,7 +57,9 @@ splash.append(eco2)
|
|||
clue.display.show(splash)
|
||||
|
||||
# setup SGP30 and wait for initial warm up
|
||||
sgp30 = adafruit_sgp30.Adafruit_SGP30(board.I2C())
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
sgp30 = adafruit_sgp30.Adafruit_SGP30(i2c)
|
||||
time.sleep(15)
|
||||
|
||||
# loop forever
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ gauge = servo.Servo(pwm)
|
|||
|
||||
# bmp280 sensor setup
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c)
|
||||
|
||||
# change depending on your location's elevation
|
||||
|
|
|
|||
|
|
@ -83,7 +83,8 @@ audio = AudioOut(board.A0) # Speaker
|
|||
wave_file = None
|
||||
|
||||
# Set up accelerometer on I2C bus, 4G range:
|
||||
i2c = board.I2C()
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
accel = adafruit_lis3dh.LIS3DH_I2C(i2c)
|
||||
accel.range = adafruit_lis3dh.RANGE_4_G
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,8 @@ audio = AudioOut(board.A0) # Speaker
|
|||
wave_file = None
|
||||
|
||||
# Set up accelerometer on I2C bus, 4G range:
|
||||
i2c = board.I2C()
|
||||
i2c = board.I2C() # uses board.SCL and board.SDA
|
||||
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
|
||||
accel = adafruit_lis3dh.LIS3DH_I2C(i2c)
|
||||
accel.range = adafruit_lis3dh.RANGE_4_G
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue