add: humidity (WIP)
This commit is contained in:
		
							
								
								
									
										9
									
								
								vendor/periph.io/x/periph/conn/physic/doc.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								vendor/periph.io/x/periph/conn/physic/doc.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
// Copyright 2018 The Periph Authors. All rights reserved.
 | 
			
		||||
// Use of this source code is governed under the Apache License, Version 2.0
 | 
			
		||||
// that can be found in the LICENSE file.
 | 
			
		||||
 | 
			
		||||
// Package physic declares types for physical input, outputs and measurement
 | 
			
		||||
// units.
 | 
			
		||||
//
 | 
			
		||||
// This includes temperature, humidity, pressure, tension, current, etc.
 | 
			
		||||
package physic
 | 
			
		||||
							
								
								
									
										42
									
								
								vendor/periph.io/x/periph/conn/physic/physic.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								vendor/periph.io/x/periph/conn/physic/physic.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,42 @@
 | 
			
		||||
// Copyright 2018 The Periph Authors. All rights reserved.
 | 
			
		||||
// Use of this source code is governed under the Apache License, Version 2.0
 | 
			
		||||
// that can be found in the LICENSE file.
 | 
			
		||||
 | 
			
		||||
package physic
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"periph.io/x/periph/conn"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Env represents measurements from an environmental sensor.
 | 
			
		||||
type Env struct {
 | 
			
		||||
	Temperature Temperature
 | 
			
		||||
	Pressure    Pressure
 | 
			
		||||
	Humidity    RelativeHumidity
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SenseEnv represents an environmental sensor.
 | 
			
		||||
type SenseEnv interface {
 | 
			
		||||
	conn.Resource
 | 
			
		||||
 | 
			
		||||
	// Sense returns the value read from the sensor. Unsupported metrics are not
 | 
			
		||||
	// modified.
 | 
			
		||||
	Sense(env *Env) error
 | 
			
		||||
	// SenseContinuous initiates a continuous sensing at the specified interval.
 | 
			
		||||
	//
 | 
			
		||||
	// It is important to call Halt() once done with the sensing, which will turn
 | 
			
		||||
	// the device off and will close the channel.
 | 
			
		||||
	SenseContinuous(interval time.Duration) (<-chan Env, error)
 | 
			
		||||
	// Precision returns this sensor's precision.
 | 
			
		||||
	//
 | 
			
		||||
	// The env values are set to the number of bits that are significant for each
 | 
			
		||||
	// items that this sensor can measure.
 | 
			
		||||
	//
 | 
			
		||||
	// Precision is not accuracy. The sensor may have absolute and relative
 | 
			
		||||
	// errors in its measurement, that are likely well above the reported
 | 
			
		||||
	// precision. Accuracy may be improved on some sensor by using oversampling,
 | 
			
		||||
	// or doing oversampling in software. Refer to its datasheet if available.
 | 
			
		||||
	Precision(env *Env)
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1043
									
								
								vendor/periph.io/x/periph/conn/physic/units.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1043
									
								
								vendor/periph.io/x/periph/conn/physic/units.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Reference in New Issue
	
	Block a user