gobot: gobot.io/x/gobot/platforms/upboard/up2 Index | Files

package up2

import "gobot.io/x/gobot/platforms/upboard/up2"

Package up2 contains the Gobot adaptor for the Upboard UP2.

For further information refer to the UP2 README: https://github.com/hybridgroup/gobot/blob/master/platforms/upboard/up2/README.md

Index

Package Files

adaptor.go doc.go pin_map.go

Constants

const (
    // LEDRed is the built-in red LED.
    LEDRed = "red"

    // LEDBlue is the built-in blue LED.
    LEDBlue = "blue"

    // LEDGreen is the built-in green LED.
    LEDGreen = "green"

    // LEDYellow is the built-in yellow LED.
    LEDYellow = "yellow"
)

type Adaptor Uses

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

Adaptor represents a Gobot Adaptor for the Upboard UP2

func NewAdaptor Uses

func NewAdaptor() *Adaptor

NewAdaptor creates a UP2 Adaptor

func (*Adaptor) Connect Uses

func (c *Adaptor) Connect() (err error)

Connect initializes the board

func (*Adaptor) DigitalPin Uses

func (c *Adaptor) DigitalPin(pin string, dir string) (sysfsPin sysfs.DigitalPinner, err error)

DigitalPin returns matched digitalPin for specified values

func (*Adaptor) DigitalRead Uses

func (c *Adaptor) DigitalRead(pin string) (val int, err error)

DigitalRead reads digital value from the specified pin.

func (*Adaptor) DigitalWrite Uses

func (c *Adaptor) DigitalWrite(pin string, val byte) (err error)

DigitalWrite writes digital value to the specified pin.

func (*Adaptor) Finalize Uses

func (c *Adaptor) Finalize() (err error)

Finalize closes connection to board and pins

func (*Adaptor) GetConnection Uses

func (c *Adaptor) GetConnection(address int, bus int) (connection i2c.Connection, err error)

GetConnection returns a connection to a device on a specified bus. Valid bus number is [5..6] which corresponds to /dev/i2c-5 through /dev/i2c-6.

func (*Adaptor) GetDefaultBus Uses

func (c *Adaptor) GetDefaultBus() int

GetDefaultBus returns the default i2c bus for this platform

func (*Adaptor) GetSpiConnection Uses

func (c *Adaptor) GetSpiConnection(busNum, chipNum, mode, bits int, maxSpeed int64) (connection spi.Connection, err error)

GetSpiConnection returns an spi connection to a device on a specified bus. Valid bus number is [0..1] which corresponds to /dev/spidev0.0 through /dev/spidev0.1.

func (*Adaptor) GetSpiDefaultBits Uses

func (c *Adaptor) GetSpiDefaultBits() int

GetSpiDefaultBits returns the default spi number of bits for this platform.

func (*Adaptor) GetSpiDefaultBus Uses

func (c *Adaptor) GetSpiDefaultBus() int

GetSpiDefaultBus returns the default spi bus for this platform.

func (*Adaptor) GetSpiDefaultChip Uses

func (c *Adaptor) GetSpiDefaultChip() int

GetSpiDefaultChip returns the default spi chip for this platform.

func (*Adaptor) GetSpiDefaultMaxSpeed Uses

func (c *Adaptor) GetSpiDefaultMaxSpeed() int64

GetSpiDefaultMaxSpeed returns the default spi max speed for this platform.

func (*Adaptor) GetSpiDefaultMode Uses

func (c *Adaptor) GetSpiDefaultMode() int

GetSpiDefaultMode returns the default spi mode for this platform.

func (*Adaptor) Name Uses

func (c *Adaptor) Name() string

Name returns the name of the Adaptor

func (*Adaptor) PWMPin Uses

func (c *Adaptor) PWMPin(pin string) (sysfsPin sysfs.PWMPinner, err error)

PWMPin returns matched pwmPin for specified pin number

func (*Adaptor) PwmWrite Uses

func (c *Adaptor) PwmWrite(pin string, val byte) (err error)

PwmWrite writes a PWM signal to the specified pin

func (*Adaptor) ServoWrite Uses

func (c *Adaptor) ServoWrite(pin string, angle byte) (err error)

ServoWrite writes a servo signal to the specified pin

func (*Adaptor) SetName Uses

func (c *Adaptor) SetName(n string)

SetName sets the name of the Adaptor

Package up2 imports 10 packages (graph). Updated 2019-05-23. Refresh now. Tools for package owners.