us020

package
v0.0.0-...-d3d8c0c Latest Latest
Warning

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

Go to latest
Published: May 8, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package us020 allows interfacing with the US020 ultrasonic range finder.

Index

Constants

This section is empty.

Variables

View Source
var NullThermometer = &nullThermometer{}

Functions

This section is empty.

Types

type Thermometer

type Thermometer interface {
	Temperature() (float64, error)
}

type US020

type US020 struct {
	EchoPin, TriggerPin embd.DigitalPin

	Thermometer Thermometer
	// contains filtered or unexported fields
}

US020 represents a US020 ultrasonic range finder.

func New

func New(echoPin, triggerPin embd.DigitalPin, thermometer Thermometer) *US020

New creates a new US020 interface. The bus variable controls the I2C bus used to communicate with the device.

func (*US020) Close

func (d *US020) Close() error

Close.

func (*US020) Distance

func (d *US020) Distance() (float64, error)

Distance computes the distance of the bot from the closest obstruction.

Jump to

Keyboard shortcuts

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