ultrasonic

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package ultrasonic implements an ultrasonic sensor based of the yahboom ultrasonic sensor

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttrConfig

type AttrConfig struct {
	TriggerPin    string `json:"trigger_pin"`
	EchoInterrupt string `json:"echo_interrupt_pin"`
	Board         string `json:"board"`
}

AttrConfig is used for converting config attributes.

func (*AttrConfig) Validate

func (config *AttrConfig) Validate(path string) ([]string, error)

Validate ensures all parts of the config are valid.

type Sensor

type Sensor struct {
	Name string

	generic.Unimplemented
	// contains filtered or unexported fields
}

Sensor ultrasonic sensor.

func (*Sensor) Close

func (s *Sensor) Close() error

Close remove interrupt callback of ultrasonic sensor.

func (*Sensor) Readings

func (s *Sensor) Readings(ctx context.Context, extra map[string]interface{}) (map[string]interface{}, error)

Readings returns the calculated distance.

Jump to

Keyboard shortcuts

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