package
0.13.0
Repository: https://github.com/hybridgroup/gobot.git
Documentation: pkg.go.dev

# 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 -d -u github.com/hybridgroup/gobot/... && go install github.com/hybridgroup/gobot/platforms/gpio

Hardware Support

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

  • Analog Sensor
  • Button
  • Buzzer
  • Direct Pin
  • Grove Touch Sensor
  • Grove Sound Sensor
  • Grove Button
  • Grove Buzzer
  • Grove Light Sensor
  • Grove Piezo Vibration Sensor
  • Grove LED
  • Grove Rotary Dial
  • Grove Relay
  • Grove Temperature Sensor
  • LED
  • Makey Button
  • Motor
  • Relay
  • RGB LED
  • Servo

More drivers are coming soon...

# Functions

NewAnalogSensorDriver returns a new AnalogSensorDriver with a polling interval of 10 Milliseconds given an AnalogReader, name and pin.
NewButtonDriver returns a new ButtonDriver with a polling interval of 10 Milliseconds given a DigitalReader, name and pin.
NewBuzzerDriver return a new BuzzerDriver given a DigitalWriter, name and pin.
NewDirectPinDriver return a new DirectPinDriver given a Connection, name and pin.
NewGroveButtonDriver returns a new GroveButtonDriver with a polling interval of 10 Milliseconds given a DigitalReader, name and pin.
NewGroveBuzzerDriver return a new GroveBuzzerDriver given a DigitalWriter, name and pin.
NewGroveLedDriver return a new GroveLedDriver given a DigitalWriter, name and pin.
NewGroveLightSensorDriver returns a new GroveLightSensorDriver with a polling interval of 10 Milliseconds given an AnalogReader, name and pin.
NewGrovePiezoVibrationSensorDriver returns a new GrovePiezoVibrationSensorDriver with a polling interval of 10 Milliseconds given an AnalogReader, name and pin.
NewGroveRelayDriver return a new GroveRelayDriver given a DigitalWriter, name and pin.
NewGroveRotaryDriver returns a new GroveRotaryDriver with a polling interval of 10 Milliseconds given an AnalogReader, name and pin.
NewGroveSoundSensorDriver returns a new GroveSoundSensorDriver with a polling interval of 10 Milliseconds given an AnalogReader, name and pin.
NewGroveTemperatureSensorDriver returns a new GroveTemperatureSensorDriver with a polling interval of 10 Milliseconds given an AnalogReader, name and pin.
NewGroveTouchDriver returns a new GroveTouchDriver with a polling interval of 10 Milliseconds given a DigitalReader, name and pin.
NewLedDriver return a new LedDriver given a DigitalWriter, name and pin.
NewMakeyButtonDriver returns a new MakeyButtonDriver with a polling interval of 10 Milliseconds given a DigitalReader, name and pin.
NewMotorDriver return a new MotorDriver given a DigitalWriter, name and pin.
NewRelayDriver return a new RelayDriver given a DigitalWriter, name and pin.
NewRgbLedDriver return a new RgbLedDriver given a DigitalWriter, name and 3 pins: redPin, greenPin, and bluePin Adds the following API Commands: "SetRGB" - See RgbLedDriver.SetRGB "Toggle" - See RgbLedDriver.Toggle "On" - See RgbLedDriver.On "Off" - See RgbLedDriver.Off.
NewServoDriver returns a new ServoDriver given a ServoWriter, name and pin.

# Constants

# Variables

ErrAnalogReadUnsupported is error resulting when a driver attempts to use hardware capabilities which a connection does not support.
ErrDigitalReadUnsupported is the error resulting when a driver attempts to use hardware capabilities which a connection does not support.
ErrDigitalWriteUnsupported is the error resulting when a driver attempts to use hardware capabilities which a connection does not support.
ErrPwmWriteUnsupported is the error resulting when a driver attempts to use hardware capabilities which a connection does not support.
ErrServoOutOfRange is the error resulting when a driver attempts to use hardware capabilities which a connection does not support.
ErrServoWriteUnsupported is the error resulting when a driver attempts to use hardware capabilities which a connection does not support.

# Structs

AnalogSensorDriver represents an Analog Sensor.
ButtonDriver Represents a digital Button.
BuzzerDriver represents a digital buzzer.
DirectPinDriver represents a GPIO pin.
GroveButtonDriver represents a button sensor with a Grove connector.
GroveBuzzerDriver represents a buzzer with a Grove connector.
GroveLedDriver represents an LED with a Grove connector.
GroveLightSensorDriver represents an analog light sensor with a Grove connector.
GrovePiezoVibrationSensorDriver represents an analog vibration sensor with a Grove connector.
GroveRelayDriver represents a Relay with a Grove connector.
GroveRotaryDriver represents an analog rotary dial with a Grove connector.
GroveSoundSensorDriver represents a analog sound sensor with a Grove connector.
GroveTemperatureSensorDriver represents a Temperature Sensor.
GroveTouchDriver represents a touch button sensor with a Grove connector.
LedDriver represents a digital Led.
MakeyButtonDriver Represents a Makey Button.
MotorDriver Represents a Motor.
RelayDriver represents a digital relay.
RgbLedDriver represents a digital RGB Led.
ServoDriver Represents a Servo.

# Interfaces

AnalogReader interface represents an Adaptor which has Analog capabilities.
DigitalReader interface represents an Adaptor which has DigitalRead capabilities.
DigitalWriter interface represents an Adaptor which has DigitalWrite capabilities.
PwmWriter interface represents an Adaptor which has Pwm capabilities.
ServoWriter interface represents an Adaptor which has Servo capabilities.