Esempio n. 1
0
def test_gas_read_adc_default_gain(GPIO, smbus):
    from enviroplus import gas
    gas._is_setup = False

    gas.enable_adc(True)
    gas.set_adc_gain(gas.MICS6814_GAIN)
    assert gas.read_adc() == 0.765
Esempio n. 2
0
def test_gas_read_adc_str(GPIO, smbus):
    from enviroplus import gas
    gas._is_setup = False

    gas.enable_adc(True)
    gas.set_adc_gain(2.048)
    assert 'ADC' in str(gas.read_all())
Esempio n. 3
0
def test_gas_read_adc(GPIO, smbus):
    from enviroplus import gas
    gas._is_setup = False

    gas.enable_adc(True)
    gas.set_adc_gain(2.048)
    assert gas.read_adc() == 0.255
Esempio n. 4
0
    from ltr559 import LTR559
    ltr559 = LTR559()
except ImportError:
    import ltr559
from enviroplus import gas
from enviroplus.noise import Noise

try:
    from smbus2 import SMBus
except ImportError:
    from smbus import SMBus

import json

gas.enable_adc()
gas.set_adc_gain(4.096)

print("""luftdaten.py - Reads temperature, pressure, humidity,
PM2.5, and PM10 from Enviro plus and sends data to Luftdaten,
the citizen science air quality project.

Note: you'll need to register with Luftdaten at:
https://meine.luftdaten.info/ and enter your Raspberry Pi
serial number that's displayed on the Enviro plus LCD along
with the other details before the data appears on the
Luftdaten map.

Press Ctrl+C to exit!

""")