mics6814

package
v0.0.0-...-4d5c8f7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2021 License: BSD-2-Clause Imports: 10 Imported by: 1

Documentation

Overview

Driver to read read the MICS6814 via an ads1015 ADC

Reference driver: https://github.com/pimoroni/enviroplus-python/blob/master/library/enviroplus/gas.py

Index

Constants

This section is empty.

Variables

View Source
var DefaultOpts = &Opts{
	Wait:       1 * time.Second,
	I2cAddress: 0x49,
}

Functions

This section is empty.

Types

type Device

type Device struct {
	// contains filtered or unexported fields
}

func New

func New() (*Device, error)

func NewWithOpts

func NewWithOpts(opts Opts) (*Device, error)

func (*Device) Halt

func (dev *Device) Halt()

func (*Device) LastValue

func (dev *Device) LastValue() Readings

Return the last value read from the sensor

Call StartReading() first to start reading values from the sensor.

func (*Device) StartReading

func (dev *Device) StartReading()

type Opts

type Opts struct {
	Wait       time.Duration // wait time between readings
	I2cAddress byte
}

type Readings

type Readings struct {
	Oxidising float64
	Reducing  float64
	NH3       float64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL