analog

package
v0.0.0-...-fab637b Latest Latest
Warning

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

Go to latest
Published: May 2, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Type = eng.DefineComponentType("gobot.analog",
	eng.ComponentFactoryFunc(func(ref v0.ComponentRef) (v0.Component, error) {
		return NewComponent(ref)
	})).
	Describe("[GoBot] Analog Sensor").
	Register()

Type is the Component type

Functions

func NewComponent

func NewComponent(ref v0.ComponentRef) (v0.Component, error)

NewComponent creates a Component

Types

type Component

type Component struct {
	Config
	Adapter cmn.Adapter `inject:"io" map:"-"`
	// contains filtered or unexported fields
}

Component is the implement of analog sensor Component

func (*Component) Endpoints

func (s *Component) Endpoints() []mqhub.Endpoint

Endpoints implements v0.Stateful

func (*Component) Ref

func (s *Component) Ref() v0.ComponentRef

Ref implements v0.Component

func (*Component) Start

func (s *Component) Start() error

Start implements v0.LifecycleCtl

func (*Component) Stop

func (s *Component) Stop() error

Stop implements v0.LifecycleCtl

func (*Component) Type

func (s *Component) Type() v0.ComponentType

Type implements v0.Component

type Config

type Config struct {
	Pin      string `map:"pin"`
	Div      int    `map:"div"`
	Interval int    `map:"interval"`
}

Config defines analog sensor configuration

Jump to

Keyboard shortcuts

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