helpers

package
v0.0.0-...-5790aad Latest Latest
Warning

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

Go to latest
Published: May 31, 2019 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package helpers has helper routines for tinkerforge Author: Tim Scheuermann (https://github.com/noxer)

Index

Constants

This section is empty.

Variables

View Source
var (
	// DeviceIdentifiers is a map from the device ID to the name of the bricklet
	DeviceIdentifiers = map[uint16]string{
		11:  "Brick DC",
		13:  "Brick Master",
		14:  "Brick Servo",
		15:  "Brick Stepper",
		16:  "Brick IMU",
		17:  "Brick RED",
		21:  "Bricklet Ambient Light",
		23:  "Bricklet Current12",
		24:  "Bricklet Current25",
		25:  "Bricklet Distance IR",
		26:  "Bricklet Dual Relay",
		27:  "Bricklet Humidity",
		28:  "Bricklet IO-16",
		29:  "Bricklet IO-4",
		210: "Bricklet Joystick",
		211: "Bricklet LCD 16x2",
		212: "Bricklet LCD 20x4",
		213: "Bricklet Linear Poti",
		214: "Bricklet Piezo Buzzer",
		215: "Bricklet Rotary Poti",
		216: "Bricklet Temperature",
		217: "Bricklet Temperature IR",
		218: "Bricklet Voltage",
		219: "Bricklet Analog In",
		220: "Bricklet Analog Out",
		221: "Bricklet Barometer",
		222: "Bricklet GPS",
		223: "Bricklet Industrial Digital In 4",
		224: "Bricklet Industrial Digital Out 4",
		225: "Bricklet Industrial Quad Relay",
		226: "Bricklet PTC",
		227: "Bricklet Voltage/Current",
		228: "Bricklet Industrial Dual 0-20mA",
		229: "Bricklet Distance US",
		230: "Bricklet Dual Button",
		231: "Bricklet LED Strip",
		232: "Bricklet Moisture",
		233: "Bricklet Motion Detector",
		234: "Bricklet Multi Touch",
		235: "Bricklet Remote Switch",
		236: "Bricklet Rotary Encoder",
		237: "Bricklet Segment Display 4x7",
		238: "Bricklet Sound Intensity",
		239: "Bricklet Tilt",
		240: "Bricklet Hall Effect",
		241: "Bricklet Line",
		242: "Bricklet Piezo Speaker",
		243: "Bricklet Color",
		244: "Bricklet Solid State Relay",
		245: "Bricklet Heart Rate",
		246: "Bricklet NFC/RFID",
	}
)

Functions

func Base58ToU32

func Base58ToU32(str string) (uint32, error)

Types

type BrickletIdentity

type BrickletIdentity struct {
	UID              string
	ConnectedUID     string
	Position         byte
	HardwareVersion  Version
	FirmwareVersion  Version
	DeviceIdentifier uint16
}

BrickletIdentity holds identity information of a bricklet

func GetIdentity

func GetIdentity(t tinkerforge.Tinkerforge, uid uint32) (*BrickletIdentity, error)

GetIdentity queries idenitity information from a bricklet

func (*BrickletIdentity) DeviceName

func (i *BrickletIdentity) DeviceName() string

DeviceName translates the device ID into a human readable name

type Version

type Version [3]byte

Version represents a bricklet version number

func NewVersion

func NewVersion(main, sub, patch byte) Version

NewVersion creates a new Version array

func (Version) String

func (v Version) String() string

String prints a version array

Jump to

Keyboard shortcuts

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