Exemple #1
0
 def __init__(self, config):
     SensorWrapper.__init__(self, config)
     # I2C bus
     self.bus = SMBus(1)
     # Create sensor object
     self.sensor = SGP30(self.bus)
     self.sensor.init_sgp()
Exemple #2
0
 def __init__(self, config):
     SensorWrapper.__init__(self, config)
     # Additional config option for i2c address, default to 0x33
     self.address = int(config.get('address', "0x33"), 16)
     # Create sensor object
     self.sensor = seeed_mlx9064x.grove_mxl90640(address=self.address)
     self.sensor.refresh_rate = seeed_mlx9064x.RefreshRate.REFRESH_4_HZ
Exemple #3
0
 def __init__(self, config):
     SensorWrapper.__init__(self, config)
     # Additional config option for i2c address, default to 0x5A
     self.address = int(config.get('address', "0x5A"), 16)
     # I2C bus
     self.bus = SMBus(1)
     # Create sensor object
     self.sensor = MLX90614(self.bus, address=self.address)
Exemple #4
0
 def __init__(self, config):
     SensorWrapper.__init__(self, config)
     self.min_a = int(config.get('min_a', 25))
     self.max_a = int(config.get('max_a', 30))
     self.min_b = int(config.get('min_b', 25))
     self.max_b = int(config.get('max_b', 30))
     self.min_c = int(config.get('min_c', 25))
     self.max_c = int(config.get('max_c', 30))
Exemple #5
0
    def __init__(self, config):
        SensorWrapper.__init__(self, config)

        # Try importing the RPi GPIO module but don't throw an error if it fails, instead try to import the Jetson one
        # If that fails too, let it throw an error
        try:
            import RPi.GPIO as GPIO
        except ImportError:
            import Jetson.GPIO as GPIO

        # Get assigned pin that hall effect sensor is attached to
        self.pin = config.get(int("pin"), 17)
        # Setup GPIO
        GPIO.setmode(GPIO.BCM)
        GPIO.setup(self.pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
 def __init__(self, config):
     SensorWrapper.__init__(self, config)
     # Report in GB with 2dp by default, but allow other precisions
     self.precision = int(config.get('precision', 2))
Exemple #7
0
 def __init__(self, config):
     SensorWrapper.__init__(self, config)
Exemple #8
0
 def __init__(self, config):
     SensorWrapper.__init__(self, config)
     # Additional config option for i2c address, default to 0x69
     self.address = int(config.get('address', "0x69"), 16)
     # Create sensor object
     self.sensor = AMG88xx(address=self.address)
Exemple #9
0
 def __init__(self, config):
     SensorWrapper.__init__(self, config)
     self.min = int(config.get('min', 25))
     self.max = int(config.get('max', 30))