pca9685

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Type = eng.DefineComponentType("gobot.drv.pca9685",
	eng.ComponentFactoryFunc(func(ref v0.ComponentRef) (v0.Component, error) {
		return NewComponent(ref)
	})).
	Describe("[GoBot] PCA9685 Driver (I2C)").
	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:"i2c" map:"-"`
	// contains filtered or unexported fields
}

Component is the implement of PCA9685 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) SetPWMFrequency

func (s *Component) SetPWMFrequency(freq uint) error

SetPWMFrequency implements common.PWMDriver

func (*Component) SetPWMPulse

func (s *Component) SetPWMPulse(chn int, on uint, off uint) error

SetPWMPulse implements common.PWMDriver

func (*Component) Start

func (s *Component) Start() (err 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 {
	Freq uint `map:"frequency"`
	Wait int  `map:"wait"`
}

Config defines servo configuration

type State

type State struct {
	Freq uint `json:"freq"`
}

State defines the state of this component

Jump to

Keyboard shortcuts

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