Documentation ¶
Overview ¶
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 ¶
- Constants
- type Adaptor
- func (c *Adaptor) Connect() (err error)
- func (c *Adaptor) DigitalPin(pin string, dir string) (sysfsPin sysfs.DigitalPinner, err error)
- func (c *Adaptor) DigitalRead(pin string) (val int, err error)
- func (c *Adaptor) DigitalWrite(pin string, val byte) (err error)
- func (c *Adaptor) Finalize() (err error)
- func (c *Adaptor) GetConnection(address int, bus int) (connection i2c.Connection, err error)
- func (c *Adaptor) GetDefaultBus() int
- func (c *Adaptor) GetSpiConnection(busNum, chipNum, mode, bits int, maxSpeed int64) (connection spi.Connection, err error)
- func (c *Adaptor) GetSpiDefaultBits() int
- func (c *Adaptor) GetSpiDefaultBus() int
- func (c *Adaptor) GetSpiDefaultChip() int
- func (c *Adaptor) GetSpiDefaultMaxSpeed() int64
- func (c *Adaptor) GetSpiDefaultMode() int
- func (c *Adaptor) Name() string
- func (c *Adaptor) PWMPin(pin string) (sysfsPin sysfs.PWMPinner, err error)
- func (c *Adaptor) PwmWrite(pin string, val byte) (err error)
- func (c *Adaptor) ServoWrite(pin string, angle byte) (err error)
- func (c *Adaptor) SetName(n string)
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" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adaptor ¶
type Adaptor struct {
// contains filtered or unexported fields
}
Adaptor represents a Gobot Adaptor for the Upboard UP2
func (*Adaptor) DigitalPin ¶
DigitalPin returns matched digitalPin for specified values
func (*Adaptor) DigitalRead ¶
DigitalRead reads digital value from the specified pin.
func (*Adaptor) DigitalWrite ¶
DigitalWrite writes digital value to the specified pin.
func (*Adaptor) GetConnection ¶
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 ¶
GetDefaultBus returns the default i2c bus for this platform
func (*Adaptor) GetSpiConnection ¶
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 ¶ added in v1.12.0
GetSpiDefaultBits returns the default spi number of bits for this platform.
func (*Adaptor) GetSpiDefaultBus ¶
GetSpiDefaultBus returns the default spi bus for this platform.
func (*Adaptor) GetSpiDefaultChip ¶ added in v1.12.0
GetSpiDefaultChip returns the default spi chip for this platform.
func (*Adaptor) GetSpiDefaultMaxSpeed ¶
GetSpiDefaultMaxSpeed returns the default spi max speed for this platform.
func (*Adaptor) GetSpiDefaultMode ¶
GetSpiDefaultMode returns the default spi mode for this platform.
func (*Adaptor) ServoWrite ¶
ServoWrite writes a servo signal to the specified pin