gpio

package
v0.0.0-...-d941a39 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2014 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

README

GPIO

This package provides drivers for General Purpose Input/Output (GPIO) devices . It is normally not used directly, but instead is registered by an adaptor such as firmata that supports the needed interfaces for GPIO devices.

Getting Started

Installing

go get github.com/hybridgroup/gobot && go install github.com/hybridgroup/platforms/gpio

Hardware Support

Gobot has a extensible system for connecting to hardware devices. The following GPIO devices are currently supported:

  • Analog Sensor
  • Button
  • Direct Pin
  • LED
  • Makey Button
  • Motor
  • Servo

More drivers are coming soon...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalogReader

type AnalogReader interface {
	AnalogRead(string) int
}

type AnalogSensorDriver

type AnalogSensorDriver struct {
	gobot.Driver
}

func NewAnalogSensorDriver

func NewAnalogSensorDriver(a AnalogReader, name string, pin string) *AnalogSensorDriver

func (*AnalogSensorDriver) Halt

func (a *AnalogSensorDriver) Halt() bool

func (*AnalogSensorDriver) Init

func (a *AnalogSensorDriver) Init() bool

func (*AnalogSensorDriver) Read

func (a *AnalogSensorDriver) Read() int

func (*AnalogSensorDriver) Start

func (a *AnalogSensorDriver) Start() bool

type AnalogWriter

type AnalogWriter interface {
	AnalogWrite(string, byte)
}

type ButtonDriver

type ButtonDriver struct {
	gobot.Driver
	Active bool
}

func NewButtonDriver

func NewButtonDriver(a DigitalReader, name string, pin string) *ButtonDriver

func (*ButtonDriver) Halt

func (b *ButtonDriver) Halt() bool

func (*ButtonDriver) Init

func (b *ButtonDriver) Init() bool

func (*ButtonDriver) Start

func (b *ButtonDriver) Start() bool

type DigitalReader

type DigitalReader interface {
	DigitalRead(string) int
}

type DigitalWriter

type DigitalWriter interface {
	DigitalWrite(string, byte)
}

type DirectPinDriver

type DirectPinDriver struct {
	gobot.Driver
}

func NewDirectPinDriver

func NewDirectPinDriver(a DirectPin, name string, pin string) *DirectPinDriver

func (*DirectPinDriver) AnalogRead

func (d *DirectPinDriver) AnalogRead() int

func (*DirectPinDriver) AnalogWrite

func (d *DirectPinDriver) AnalogWrite(level byte)

func (*DirectPinDriver) DigitalRead

func (d *DirectPinDriver) DigitalRead() int

func (*DirectPinDriver) DigitalWrite

func (d *DirectPinDriver) DigitalWrite(level byte)

func (*DirectPinDriver) Halt

func (d *DirectPinDriver) Halt() bool

func (*DirectPinDriver) Init

func (d *DirectPinDriver) Init() bool

func (*DirectPinDriver) PwmWrite

func (d *DirectPinDriver) PwmWrite(level byte)

func (*DirectPinDriver) ServoWrite

func (d *DirectPinDriver) ServoWrite(level byte)

func (*DirectPinDriver) Start

func (d *DirectPinDriver) Start() bool

type LedDriver

type LedDriver struct {
	gobot.Driver
	High bool
}

func NewLedDriver

func NewLedDriver(a PwmDigitalWriter, name string, pin string) *LedDriver

func (*LedDriver) Brightness

func (l *LedDriver) Brightness(level byte)

func (*LedDriver) Halt

func (l *LedDriver) Halt() bool

func (*LedDriver) Init

func (l *LedDriver) Init() bool

func (*LedDriver) IsOff

func (l *LedDriver) IsOff() bool

func (*LedDriver) IsOn

func (l *LedDriver) IsOn() bool

func (*LedDriver) Off

func (l *LedDriver) Off() bool

func (*LedDriver) On

func (l *LedDriver) On() bool

func (*LedDriver) Start

func (l *LedDriver) Start() bool

func (*LedDriver) Toggle

func (l *LedDriver) Toggle()

type MakeyButtonDriver

type MakeyButtonDriver struct {
	gobot.Driver
	Adaptor DigitalReader
	Active  bool
	// contains filtered or unexported fields
}

func NewMakeyButtonDriver

func NewMakeyButtonDriver(a DigitalReader, name string, pin string) *MakeyButtonDriver

func (*MakeyButtonDriver) Halt

func (m *MakeyButtonDriver) Halt() bool

func (*MakeyButtonDriver) Init

func (m *MakeyButtonDriver) Init() bool

func (*MakeyButtonDriver) Start

func (m *MakeyButtonDriver) Start() bool

type MotorDriver

type MotorDriver struct {
	gobot.Driver
	SpeedPin         string
	SwitchPin        string
	DirectionPin     string
	ForwardPin       string
	BackwardPin      string
	CurrentState     byte
	CurrentSpeed     byte
	CurrentMode      string
	CurrentDirection string
}

func NewMotorDriver

func NewMotorDriver(a PwmDigitalWriter, name string, pin string) *MotorDriver

func (*MotorDriver) Backward

func (m *MotorDriver) Backward(speed byte)

func (*MotorDriver) Direction

func (m *MotorDriver) Direction(direction string)

func (*MotorDriver) Forward

func (m *MotorDriver) Forward(speed byte)

func (*MotorDriver) Halt

func (m *MotorDriver) Halt() bool

func (*MotorDriver) Init

func (m *MotorDriver) Init() bool

func (*MotorDriver) IsOff

func (m *MotorDriver) IsOff() bool

func (*MotorDriver) IsOn

func (m *MotorDriver) IsOn() bool

func (*MotorDriver) Max

func (m *MotorDriver) Max()

func (*MotorDriver) Min

func (m *MotorDriver) Min()

func (*MotorDriver) Off

func (m *MotorDriver) Off()

func (*MotorDriver) On

func (m *MotorDriver) On()

func (*MotorDriver) Speed

func (m *MotorDriver) Speed(value byte)

func (*MotorDriver) Start

func (m *MotorDriver) Start() bool

func (*MotorDriver) Toggle

func (m *MotorDriver) Toggle()

type Pwm

type Pwm interface {
	PwmWrite(string, byte)
}

type PwmDigitalWriter

type PwmDigitalWriter interface {
	DigitalWriter
	Pwm
}

type Servo

type Servo interface {
	InitServo()
	ServoWrite(string, byte)
}

type ServoDriver

type ServoDriver struct {
	gobot.Driver
	CurrentAngle byte
}

func NewServoDriver

func NewServoDriver(a Servo, name string, pin string) *ServoDriver

func (*ServoDriver) Center

func (s *ServoDriver) Center()

func (*ServoDriver) Halt

func (s *ServoDriver) Halt() bool

func (*ServoDriver) Init

func (s *ServoDriver) Init() bool

func (*ServoDriver) InitServo

func (s *ServoDriver) InitServo()

func (*ServoDriver) Max

func (s *ServoDriver) Max()

func (*ServoDriver) Min

func (s *ServoDriver) Min()

func (*ServoDriver) Move

func (s *ServoDriver) Move(angle uint8)

func (*ServoDriver) Start

func (s *ServoDriver) Start() bool

Jump to

Keyboard shortcuts

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