How to use the enviroplus.gas.set_adc_gain function in enviroplus

To help you get started, we’ve selected a few enviroplus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pimoroni / enviroplus-python / examples / adc.py View on Github external
from enviroplus import gas
import logging

logging.basicConfig(
    format='%(asctime)s.%(msecs)03d %(levelname)-8s %(message)s',
    level=logging.INFO,
    datefmt='%Y-%m-%d %H:%M:%S')

logging.info("""adc.py - Print readings from the MICS6814 Gas sensor.

Press Ctrl+C to exit!

""")

gas.enable_adc()
gas.set_adc_gain(4.096)

try:
    while True:
        readings = gas.read_all()
        logging.info(readings)
        time.sleep(1.0)
except KeyboardInterrupt:
    pass

enviroplus

Enviro pHAT Plus environmental monitoring add-on for Raspberry Pi

MIT
Latest version published 8 months ago

Package Health Score

55 / 100
Full package analysis

Similar packages