X-Git-Url: https://zdv2.bktei.com/gitweb/EVA-2020-02-2.git/blobdiff_plain/d8a05f16804f6c57f1054d0e3c8962265380fe6b..a36c0e8d8d94eae0353e5bff14ac837e17139671:/examples/adc.py?ds=inline diff --git a/examples/adc.py b/examples/adc.py index c4cf45c..82bda41 100755 --- a/examples/adc.py +++ b/examples/adc.py @@ -2,8 +2,14 @@ import time from enviroplus import gas +import logging -print("""adc.py - Print readings from the MICS6814 Gas sensor. +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! @@ -15,7 +21,7 @@ gas.set_adc_gain(4.096) try: while True: readings = gas.read_all() - print(readings) + logging.info(readings) time.sleep(1.0) except KeyboardInterrupt: pass