Esempio n. 1
0
# CCS811_RPi class usage example
#
# Petr Lukas
# July, 11 2017
#
# Version 1.0

import time
#import urllib2 # comment this line if you don't need ThinkSpeak connection
import SDL_Pi_HDC1000  # comment this line if you don't use HDC sensor

from CCS811_RPi import CCS811_RPi

ccs811 = CCS811_RPi()

# Do you want to send data to thingSpeak? If yes set WRITE API KEY, otherwise set False
THINGSPEAK = False  # or type 'YOURAPIKEY'

# Do you want to preset sensor baseline? If yes set the value here, otherwise set False
INITIALBASELINE = False

# Do you want to use integrated temperature meter to compensate temp/RH (CJMCU-8118 board)?
# If not pre-set sensor compensation temperature is 25 C and RH is 50 %
# You can compensate manually by method ccs811.setCompensation(temperature,humidity)
HDC1080 = True
'''
MEAS MODE REGISTER AND DRIVE MODE CONFIGURATION
0b0       Idle (Measurements are disabled in this mode)
0b10000   Constant power mode, IAQ measurement every second
0b100000  Pulse heating mode IAQ measurement every 10 seconds
0b110000  Low power pulse heating mode IAQ measurement every 60
Esempio n. 2
0
 def set_address(self, address):
     super().set_address(address)
     # Here we overrule the set_address function in order to load the hardware before using it
     self.__device = CCS811_RPi(addr=address)
     self.__device.configureSensor(terrariumCCS811Sensor.MODE)