We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 587800a + 27ab20d commit fd3ad93Copy full SHA for fd3ad93
library/enviroplus/gas.py
@@ -41,15 +41,19 @@ def __repr__(self):
41
42
43
def setup():
44
- global adc, _is_setup
+ global adc, adc_type, _is_setup
45
if _is_setup:
46
return
47
_is_setup = True
48
49
adc = ads1015.ADS1015(i2c_addr=0x49)
50
+ adc_type = adc.detect_chip_type()
51
adc.set_mode('single')
52
adc.set_programmable_gain(MICS6814_GAIN)
- adc.set_sample_rate(1600)
53
+ if adc_type == 'ADS1115':
54
+ adc.set_sample_rate(128)
55
+ else:
56
+ adc.set_sample_rate(1600)
57
58
GPIO.setwarnings(False)
59
GPIO.setmode(GPIO.BCM)
library/setup.cfg
@@ -32,7 +32,7 @@ install_requires =
32
pms5003
33
ltr559
34
st7735
35
- ads1015
+ ads1015 >= 0.0.7
36
fonts
37
font-roboto
38
astral
0 commit comments