Documentation ¶
Overview ¶
Package pinwrappers implements interfaces that wrap the basic board interface and return types, and expands them with new methods and interfaces for the built in board models. Current expands analog reader and digital interrupt.
Index ¶
- type AnalogSmoother
- func (as *AnalogSmoother) Close(ctx context.Context) error
- func (as *AnalogSmoother) Read(ctx context.Context, extra map[string]interface{}) (board.AnalogValue, error)
- func (as *AnalogSmoother) Start()
- func (as *AnalogSmoother) Write(ctx context.Context, value int, extra map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalogSmoother ¶
type AnalogSmoother struct { Raw board.Analog AverageOverMillis int SamplesPerSecond int // contains filtered or unexported fields }
An AnalogSmoother smooths the readings out from an underlying reader.
func SmoothAnalogReader ¶
func SmoothAnalogReader(r board.Analog, c board.AnalogReaderConfig, logger logging.Logger) *AnalogSmoother
SmoothAnalogReader wraps the given reader in a smoother.
func (*AnalogSmoother) Close ¶
func (as *AnalogSmoother) Close(ctx context.Context) error
Close stops the smoothing routine.
func (*AnalogSmoother) Read ¶
func (as *AnalogSmoother) Read(ctx context.Context, extra map[string]interface{}) (board.AnalogValue, error)
Read returns the smoothed out reading.
func (*AnalogSmoother) Start ¶
func (as *AnalogSmoother) Start()
Start begins the smoothing routine that reads from the underlying analog reader.
Click to show internal directories.
Click to hide internal directories.