Skip to content

Commit 951dd0c

Browse files
committed
more ci stuff
1 parent 1713933 commit 951dd0c

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

adafruit_si1145.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
1717
**Hardware:**
1818
19-
* `Adafruit SI1145 Digital UV Index / IR / Visible Light Sensor <https://www.adafruit.com/product/1777>`_
19+
* `Adafruit SI1145 Digital UV Index / IR / Visible Light Sensor
20+
<https://www.adafruit.com/product/1777>`_
2021
2122
**Software and Dependencies:**
2223
@@ -56,6 +57,7 @@
5657

5758

5859
class SI1145:
60+
"""Driver for the SI1145 UV, IR, Visible Light Sensor."""
5961
def __init__(self, i2c, address=SI1145_DEFAULT_ADDRESS):
6062
self._i2c = i2c_device.I2CDevice(i2c, address)
6163
dev_id, dev_rev, dev_seq = self.device_info
@@ -64,20 +66,20 @@ def __init__(self, i2c, address=SI1145_DEFAULT_ADDRESS):
6466
self.reset()
6567
self._write_register(SI1145_HW_KEY, 0x17)
6668
self._als_enabled = True
67-
self.ALS_enabled = True
69+
self.als_enabled = True
6870

6971
@property
7072
def device_info(self):
7173
"""A three tuple of part, revision, and sequencer ID"""
7274
return tuple(self._read_register(SI1145_PART_ID, 3))
7375

7476
@property
75-
def ALS_enabled(self):
77+
def als_enabled(self):
7678
"""The Ambient Light System enabled state."""
7779
return self._als_enabled
7880

79-
@ALS_enabled.setter
80-
def ALS_enabled(self, enable):
81+
@als_enabled.setter
82+
def als_enabled(self, enable):
8183
chlist = self._param_query(SI1145_RAM_CHLIST)
8284
if enable:
8385
chlist |= 0b00110000

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030

3131
intersphinx_mapping = {
32-
"python": ("https://docs.python.org/3", None),"BusDevice": ("https://docs.circuitpython.org/projects/busdevice/en/latest/", None),
33-
32+
"python": ("https://docs.python.org/3", None),
33+
"BusDevice": ("https://docs.circuitpython.org/projects/busdevice/en/latest/", None),
3434
"CircuitPython": ("https://docs.circuitpython.org/en/latest/", None),
3535
}
3636

examples/si1145_simpletest.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,20 @@
22
# SPDX-FileCopyrightText: Copyright (c) 2022 Carter Nelson for Adafruit Industries
33
#
44
# SPDX-License-Identifier: Unlicense
5+
6+
import time
7+
import board
8+
import adafruit_si1145
9+
10+
# setup I2C bus using board default
11+
# change as needed for specific boards
12+
i2c = board.I2C()
13+
14+
# setup sensor
15+
si1145 = adafruit_si1145.SI1145(i2c)
16+
17+
# loop forever printing values
18+
while True:
19+
vis, ir = si1145.ALS
20+
print("Visible = {}, Infrared = {}".format(vis, ir))
21+
time.sleep(1)

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@
5656
],
5757
# What does your project relate to?
5858
keywords="adafruit blinka circuitpython micropython si1145 ultraviolet, infrared, "
59-
"visible, light",
60-
59+
"visible, light",
6160
# You can just specify the packages manually here if your project is
6261
# simple. Or you can use find_packages().
6362
# TODO: IF LIBRARY FILES ARE A PACKAGE FOLDER,

0 commit comments

Comments
 (0)