otheri2c

package
v0.0.0-...-ac0bd47 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GPS

type GPS struct {
	// contains filtered or unexported fields
}

GPS is a handle to a dGPS device.

func OpenGPS

func OpenGPS(port string) (*GPS, error)

OpenGPS opens a GPS attached to the LEGO sensort port given. This can either be in the form inX for an EV3 input port where X is the physical port number, or N where N is the I²C bus number.

The GPS should be closed when it is no longer needed.

func (*GPS) Altitude

func (d *GPS) Altitude() (int, error)

Altitude returns the current altitude in meters. This is only valid if ExtendedFirmware(true) has been called prior to calling Altitude.

func (*GPS) AngleSinceLast

func (d *GPS) AngleSinceLast() (int, error)

AngleSinceLast returns the angle travelled since the last call to AngleSinceLast.

func (*GPS) AngleToDest

func (d *GPS) AngleToDest() (int, error)

AngleToDest returns the heading to the current destination in degrees.

func (*GPS) Close

func (d *GPS) Close() error

Close closes the device.

func (*GPS) DistanceToDest

func (d *GPS) DistanceToDest() (int, error)

DistanceToDest returns the distance to the current destination in meters.

func (*GPS) ExtendedFirmware

func (d *GPS) ExtendedFirmware(use bool) ([]byte, error)

ExtendedFirmware specifies whether to use the dGPS-X firmware extension. Turning on the extended firmware can slow down the dGPS sensor.

func (*GPS) HDOP

func (d *GPS) HDOP() (int, error)

HDOP returns the measure of the precision that can be expected. This is only valid if ExtendedFirmware(true) has been called prior to calling HDOP.

func (*GPS) Heading

func (d *GPS) Heading() (int, error)

Heading returns the current heading in degrees.

func (*GPS) Latitude

func (d *GPS) Latitude() (int, error)

Latitude returns the current latitude in millionths of a degree. A negative latitude indicates southern latitudes.

func (*GPS) Longitude

func (d *GPS) Longitude() (int, error)

Longitude returns the current latitude in millionths of a degree. A negative longitude indicates western longitudes.

func (*GPS) SatellitesInView

func (d *GPS) SatellitesInView() (int, error)

SatellitesInView returns the number of satellites in view. This is only valid if ExtendedFirmware(true) has been called prior to calling SatellitesInView.

func (*GPS) SetDestLatitude

func (d *GPS) SetDestLatitude(lat int) error

SetDestLatitude sets the latitude of the destination in millionths of a degree. A negative latitude indicates southern latitudes.

func (*GPS) SetDestLongitude

func (d *GPS) SetDestLongitude(lon int) error

SetDestLongitude sets the longitude of the destination in millionths of a degree. A negative longitude indicates western longitudes.

func (*GPS) Status

func (d *GPS) Status() (ok bool, err error)

Status returns whether the GPS values are valid.

func (*GPS) UTC

func (d *GPS) UTC() (time.Time, error)

UTC returns the time in the UTC time zone obtained from the satellite.

Note that the time returned by the satellite does not include the date, so UTC will fabricate a date based on the local time.

func (*GPS) Velocity

func (d *GPS) Velocity() (int, error)

Velocity returns the current velocity in centimeters.

Jump to

Keyboard shortcuts

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