sensor

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Motion

func Motion(p int, stream chan int64)

Motion accepts a pin to read on and a stream to write on. Streams the int64 unix time of a motion event. Close the stream to stop reading

func ReadDHT22

func ReadDHT22(pin rpio.Pin, includeWait bool) (float32, float32, bool)

func ReadMotion

func ReadMotion(pin rpio.Pin) bool

ReadMotion will check if the pin has recently seen motion.

func Therm

func Therm(p int, measureInterval time.Duration, stream chan ThermalReading)

Therm accepts a pin to read on, how often to read, and a stream. Writes ThermalReadings to the given stream. Close the stream to stop measurements.

Types

type ThermalReading

type ThermalReading struct {
	Temp float32
	Humi float32
	Time time.Time
}

ThermalReading holds a sensor measurement.

Jump to

Keyboard shortcuts

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