gobot: gobot.io/x/gobot/drivers/i2c Index | Files

package i2c

import "gobot.io/x/gobot/drivers/i2c"

Package i2c provides Gobot drivers for i2c devices.

Installing:

go get -d -u gobot.io/x/gobot

For further information refer to i2c README: https://github.com/hybridgroup/gobot/blob/master/drivers/i2c/README.md

Index

Package Files

adafruit_driver.go ads1x15_driver.go adxl345_driver.go bh1750_driver.go blinkm_driver.go bme280_driver.go bmp180_driver.go bmp280_driver.go doc.go drv2605l_driver.go grove_drivers.go hmc6352_driver.go i2c.go i2c_config.go ina3221_driver.go jhd1313m1_driver.go l3gd20h_driver.go lidarlite_driver.go mcp23017_driver.go mma7660_driver.go mpl115a2_driver.go mpu6050_driver.go pca9685_driver.go sht3x_driver.go ssd1306_driver.go tsl2561_driver.go wiichuck_driver.go

Constants

const (
    // Data rate
    ADXL345_RATE_3200HZ = 0x0F // 3200 Hz
    ADXL345_RATE_1600HZ = 0x0E // 1600 Hz
    ADXL345_RATE_800HZ  = 0x0D // 800 Hz
    ADXL345_RATE_400HZ  = 0x0C // 400 Hz
    ADXL345_RATE_200HZ  = 0x0B // 200 Hz
    ADXL345_RATE_100HZ  = 0x0A // 100 Hz
    ADXL345_RATE_50HZ   = 0x09 // 50 Hz
    ADXL345_RATE_25HZ   = 0x08 // 25 Hz
    ADXL345_RATE_12_5HZ = 0x07 // 12.5 Hz
    ADXL345_RATE_6_25HZ = 0x06 // 6.25 Hz
    ADXL345_RATE_3_13HZ = 0x05 // 3.13 Hz
    ADXL345_RATE_1_56HZ = 0x04 // 1.56 Hz
    ADXL345_RATE_0_78HZ = 0x03 // 0.78 Hz
    ADXL345_RATE_0_39HZ = 0x02 // 0.39 Hz
    ADXL345_RATE_0_20HZ = 0x01 // 0.20 Hz
    ADXL345_RATE_0_10HZ = 0x00 // 0.10 Hz

    // Data range
    ADXL345_RANGE_2G  = 0x00 // +-2 g
    ADXL345_RANGE_4G  = 0x01 // +-4 g
    ADXL345_RANGE_8G  = 0x02 // +-8 g
    ADXL345_RANGE_16G = 0x03 // +-16 g)

    ADXL345_REG_DEVID          = 0x00 // R,     11100101,   Device ID
    ADXL345_REG_THRESH_TAP     = 0x1D // R/W,   00000000,   Tap threshold
    ADXL345_REG_OFSX           = 0x1E // R/W,   00000000,   X-axis offset
    ADXL345_REG_OFSY           = 0x1F // R/W,   00000000,   Y-axis offset
    ADXL345_REG_OFSZ           = 0x20 // R/W,   00000000,   Z-axis offset
    ADXL345_REG_DUR            = 0x21 // R/W,   00000000,   Tap duration
    ADXL345_REG_LATENT         = 0x22 // R/W,   00000000,   Tap latency
    ADXL345_REG_WINDOW         = 0x23 // R/W,   00000000,   Tap window
    ADXL345_REG_THRESH_ACT     = 0x24 // R/W,   00000000,   Activity threshold
    ADXL345_REG_THRESH_INACT   = 0x25 // R/W,   00000000,   Inactivity threshold
    ADXL345_REG_TIME_INACT     = 0x26 // R/W,   00000000,   Inactivity time
    ADXL345_REG_ACT_INACT_CTL  = 0x27 // R/W,   00000000,   Axis enable control for activity and inactiv ity detection
    ADXL345_REG_THRESH_FF      = 0x28 // R/W,   00000000,   Free-fall threshold
    ADXL345_REG_TIME_FF        = 0x29 // R/W,   00000000,   Free-fall time
    ADXL345_REG_TAP_AXES       = 0x2A // R/W,   00000000,   Axis control for single tap/double tap
    ADXL345_REG_ACT_TAP_STATUS = 0x2B // R,     00000000,   Source of single tap/double tap
    ADXL345_REG_BW_RATE        = 0x2C // R/W,   00001010,   Data rate and power mode control
    ADXL345_REG_POWER_CTL      = 0x2D // R/W,   00000000,   Power-saving features control
    ADXL345_REG_INT_ENABLE     = 0x2E // R/W,   00000000,   Interrupt enable control
    ADXL345_REG_INT_MAP        = 0x2F // R/W,   00000000,   Interrupt mapping control
    ADXL345_REG_INT_SOUCE      = 0x30 // R,     00000010,   Source of interrupts
    ADXL345_REG_DATA_FORMAT    = 0x31 // R/W,   00000000,   Data format control
    ADXL345_REG_DATAX0         = 0x32 // R,     00000000,   X-Axis Data 0
    ADXL345_REG_DATAX1         = 0x33 // R,     00000000,   X-Axis Data 1
    ADXL345_REG_DATAY0         = 0x34 // R,     00000000,   Y-Axis Data 0
    ADXL345_REG_DATAY1         = 0x35 // R,     00000000,   Y-Axis Data 1
    ADXL345_REG_DATAZ0         = 0x36 // R,     00000000,   Z-Axis Data 0
    ADXL345_REG_DATAZ1         = 0x37 // R,     00000000,   Z-Axis Data 1
    ADXL345_REG_FIFO_CTL       = 0x38 // R/W,   00000000,   FIFO control
    ADXL345_REG_FIFO_STATUS    = 0x39 // R,     00000000,   FIFO status
)
const (
    BH1750_POWER_DOWN                 = 0x00
    BH1750_POWER_ON                   = 0x01
    BH1750_RESET                      = 0x07
    BH1750_CONTINUOUS_HIGH_RES_MODE   = 0x10
    BH1750_CONTINUOUS_HIGH_RES_MODE_2 = 0x11
    BH1750_CONTINUOUS_LOW_RES_MODE    = 0x13
    BH1750_ONE_TIME_HIGH_RES_MODE     = 0x20
    BH1750_ONE_TIME_HIGH_RES_MODE_2   = 0x21
    BH1750_ONE_TIME_LOW_RES_MODE      = 0x23
)
const (
    DRV2605ModeIntTrig     DRV2605Mode = 0x00
    DRV2605ModeExtTrigEdge             = 0x01
    DRV2605ModeExtTrigLvl              = 0x02
    DRV2605ModePWMAnalog               = 0x03
    DRV2605ModeAudioVibe               = 0x04
    DRV2605ModeRealtime                = 0x05
    DRV2605ModeDiagnose                = 0x06
    DRV2605ModeAutocal                 = 0x07
)

Operating modes, for use in SetMode()

const (
    // BusNotInitialized is the initial value for a bus
    BusNotInitialized = -1

    // AddressNotInitialized is the initial value for an address
    AddressNotInitialized = -1
)
const (
    REG_RED   = 0x04
    REG_GREEN = 0x03
    REG_BLUE  = 0x02

    LCD_CLEARDISPLAY        = 0x01
    LCD_RETURNHOME          = 0x02
    LCD_ENTRYMODESET        = 0x04
    LCD_DISPLAYCONTROL      = 0x08
    LCD_CURSORSHIFT         = 0x10
    LCD_FUNCTIONSET         = 0x20
    LCD_SETCGRAMADDR        = 0x40
    LCD_SETDDRAMADDR        = 0x80
    LCD_ENTRYRIGHT          = 0x00
    LCD_ENTRYLEFT           = 0x02
    LCD_ENTRYSHIFTINCREMENT = 0x01
    LCD_ENTRYSHIFTDECREMENT = 0x00
    LCD_DISPLAYON           = 0x04
    LCD_DISPLAYOFF          = 0x00
    LCD_CURSORON            = 0x02
    LCD_CURSOROFF           = 0x00
    LCD_BLINKON             = 0x01
    LCD_BLINKOFF            = 0x00
    LCD_DISPLAYMOVE         = 0x08
    LCD_CURSORMOVE          = 0x00
    LCD_MOVERIGHT           = 0x04
    LCD_MOVELEFT            = 0x00
    LCD_2LINE               = 0x08
    LCD_CMD                 = 0x80
    LCD_DATA                = 0x40

    LCD_2NDLINEOFFSET = 0x40
)
const (
    MMA7660_X              = 0x00
    MMA7660_Y              = 0x01
    MMA7660_Z              = 0x02
    MMA7660_TILT           = 0x03
    MMA7660_SRST           = 0x04
    MMA7660_SPCNT          = 0x05
    MMA7660_INTSU          = 0x06
    MMA7660_MODE           = 0x07
    MMA7660_STAND_BY       = 0x00
    MMA7660_ACTIVE         = 0x01
    MMA7660_SR             = 0x08
    MMA7660_AUTO_SLEEP_120 = 0x00
    MMA7660_AUTO_SLEEP_64  = 0x01
    MMA7660_AUTO_SLEEP_32  = 0x02
    MMA7660_AUTO_SLEEP_16  = 0x03
    MMA7660_AUTO_SLEEP_8   = 0x04
    MMA7660_AUTO_SLEEP_4   = 0x05
    MMA7660_AUTO_SLEEP_2   = 0x06
    MMA7660_AUTO_SLEEP_1   = 0x07
    MMA7660_PDET           = 0x09
    MMA7660_PD             = 0x0A
)
const (
    PCA9685_MODE1        = 0x00
    PCA9685_PRESCALE     = 0xFE
    PCA9685_SUBADR1      = 0x02
    PCA9685_SUBADR2      = 0x03
    PCA9685_SUBADR3      = 0x04
    PCA9685_LED0_ON_L    = 0x06
    PCA9685_LED0_ON_H    = 0x07
    PCA9685_LED0_OFF_L   = 0x08
    PCA9685_LED0_OFF_H   = 0x09
    PCA9685_ALLLED_ON_L  = 0xFA
    PCA9685_ALLLED_ON_H  = 0xFB
    PCA9685_ALLLED_OFF_L = 0xFC
    PCA9685_ALLLED_OFF_H = 0xFD
)
const (
    // TSL2561AddressLow - the address of the device when address pin is low
    TSL2561AddressLow = 0x29
    // TSL2561AddressFloat - the address of the device when address pin is floating
    TSL2561AddressFloat = 0x39
    // TSL2561AddressHigh - the address of the device when address pin is high
    TSL2561AddressHigh = 0x49
)
const (
    // Joystick event when the Wiichuck joystick is moved
    Joystick = "joystick"

    // C event when the Wiichuck "C" button is pressed
    C   = "c"

    // Z event when the Wiichuck "C" button is pressed
    Z   = "z"
)
const (

    // ADS1x15DefaultAddress is the default I2C address for the ADS1x15 components
    ADS1x15DefaultAddress = 0x48
)
const ADXL345AddressHigh = 0x1D
const ADXL345AddressLow = 0x53
const (
    // Error event
    Error = "error"
)
const MPL115A2_REGISTER_A0_COEFF_LSB = 0x05
const MPL115A2_REGISTER_A0_COEFF_MSB = 0x04
const MPL115A2_REGISTER_B1_COEFF_LSB = 0x07
const MPL115A2_REGISTER_B1_COEFF_MSB = 0x06
const MPL115A2_REGISTER_B2_COEFF_LSB = 0x09
const MPL115A2_REGISTER_B2_COEFF_MSB = 0x08
const MPL115A2_REGISTER_C12_COEFF_LSB = 0x0B
const MPL115A2_REGISTER_C12_COEFF_MSB = 0x0A
const MPL115A2_REGISTER_PRESSURE_LSB = 0x01
const MPL115A2_REGISTER_PRESSURE_MSB = 0x00
const MPL115A2_REGISTER_STARTCONVERSION = 0x12
const MPL115A2_REGISTER_TEMP_LSB = 0x03
const MPL115A2_REGISTER_TEMP_MSB = 0x02
const MPU6050_ACCEL_FS_2 = 0x00
const MPU6050_ACONFIG_AFS_SEL_BIT = 4
const MPU6050_ACONFIG_AFS_SEL_LENGTH = 2
const MPU6050_CLOCK_PLL_XGYRO = 0x01
const MPU6050_GCONFIG_FS_SEL_BIT = 4
const MPU6050_GCONFIG_FS_SEL_LENGTH = 2
const MPU6050_GYRO_FS_250 = 0x00
const MPU6050_PWR1_CLKSEL_BIT = 2
const MPU6050_PWR1_CLKSEL_LENGTH = 3
const MPU6050_PWR1_ENABLE_BIT = 0
const MPU6050_PWR1_SLEEP_BIT = 6
const MPU6050_RA_ACCEL_CONFIG = 0x1C
const MPU6050_RA_ACCEL_XOUT_H = 0x3B
const MPU6050_RA_GYRO_CONFIG = 0x1B
const MPU6050_RA_PWR_MGMT_1 = 0x6B
const SHT3xAccuracyHigh = 0x00

SHT3xAccuracyHigh is the high accuracy and slowest sample setting

const SHT3xAccuracyLow = 0x16

SHT3xAccuracyLow is the faster, but lower accuracy sample setting

const SHT3xAccuracyMedium = 0x0b

SHT3xAccuracyMedium is the medium accuracy and speed sample setting

const SHT3xAddressA = 0x44

SHT3xAddressA is the default address of device

const SHT3xAddressB = 0x45

SHT3xAddressB is the optional address of device

Variables

var (
    ErrEncryptedBytes  = errors.New("Encrypted bytes")
    ErrNotEnoughBytes  = errors.New("Not enough bytes read")
    ErrNotReady        = errors.New("Device is not ready")
    ErrInvalidPosition = errors.New("Invalid position value")
)
var (
    ErrInvalidAccuracy = errors.New("Invalid accuracy")
    ErrInvalidCrc      = errors.New("Invalid crc")
    ErrInvalidTemp     = errors.New("Invalid temperature units")
)
var CustomLCDChars = map[string][8]byte{
    "é":       {130, 132, 142, 145, 159, 144, 142, 128},
    "è":       {136, 132, 142, 145, 159, 144, 142, 128},
    "ê":       {132, 138, 142, 145, 159, 144, 142, 128},
    "à":       {136, 134, 128, 142, 145, 147, 141, 128},
    "â":       {132, 138, 128, 142, 145, 147, 141, 128},
    "á":       {2, 4, 14, 1, 15, 17, 15, 0},
    "î":       {132, 138, 128, 140, 132, 132, 142, 128},
    "í":       {2, 4, 12, 4, 4, 4, 14, 0},
    "û":       {132, 138, 128, 145, 145, 147, 141, 128},
    "ù":       {136, 134, 128, 145, 145, 147, 141, 128},
    "ñ":       {14, 0, 22, 25, 17, 17, 17, 0},
    "ó":       {2, 4, 14, 17, 17, 17, 14, 0},
    "heart":   {0, 10, 31, 31, 31, 14, 4, 0},
    "smiley":  {0, 0, 10, 0, 0, 17, 14, 0},
    "frowney": {0, 0, 10, 0, 0, 0, 14, 17},
}

CustomLCDChars is a map of CGRAM characters that can be loaded into a LCD screen to display custom characters. Some LCD screens such as the Grove screen (jhd1313m1) isn't loaded with latin 1 characters. It's up to the developer to load the set up to 8 custom characters and update the input text so the character is swapped by a byte reflecting the position of the custom character to use. See SetCustomChar

func NewConnection Uses

func NewConnection(bus I2cDevice, address int) (connection *i2cConnection)

NewConnection creates and returns a new connection to a specific i2c device on a bus and address.

func WithADS1x15DataRate Uses

func WithADS1x15DataRate(val int) func(Config)

WithADS1x15DataRate option sets the ADS1x15Driver data rate option. Valid gain settings are any of the ADS1x15RegConfigPga* values

func WithADS1x15Gain Uses

func WithADS1x15Gain(val int) func(Config)

WithADS1x15Gain option sets the ADS1x15Driver gain option. Valid gain settings are any of the ADS1x15RegConfigPga* values

func WithAddress Uses

func WithAddress(address int) func(Config)

WithAddress sets which address to use as a optional param.

func WithBus Uses

func WithBus(bus int) func(Config)

WithBus sets which bus to use as a optional param.

func WithDisplayHeight Uses

func WithDisplayHeight(val int) func(Config)

WithDisplayHeight option sets the SSD1306Driver DisplayHeight option.

func WithDisplayWidth Uses

func WithDisplayWidth(val int) func(Config)

WithDisplayWidth option sets the SSD1306Driver DisplayWidth option.

func WithMCP23017Bank Uses

func WithMCP23017Bank(val uint8) func(Config)

WithMCP23017Bank option sets the MCP23017Driver bank option

func WithMCP23017Disslw Uses

func WithMCP23017Disslw(val uint8) func(Config)

WithMCP23017Disslw option sets the MCP23017Driver Disslw option

func WithMCP23017Haen Uses

func WithMCP23017Haen(val uint8) func(Config)

WithMCP23017Haen option sets the MCP23017Driver Haen option

func WithMCP23017Intpol Uses

func WithMCP23017Intpol(val uint8) func(Config)

WithMCP23017Intpol option sets the MCP23017Driver Intpol option

func WithMCP23017Mirror Uses

func WithMCP23017Mirror(val uint8) func(Config)

WithMCP23017Mirror option sets the MCP23017Driver Mirror option

func WithMCP23017Odr Uses

func WithMCP23017Odr(val uint8) func(Config)

WithMCP23017Odr option sets the MCP23017Driver Odr option

func WithMCP23017Seqop Uses

func WithMCP23017Seqop(val uint8) func(Config)

WithMCP23017Seqop option sets the MCP23017Driver Seqop option

func WithTSL2561AutoGain Uses

func WithTSL2561AutoGain(c Config)

WithTSL2561AutoGain option turns on TSL2561Driver auto gain

func WithTSL2561Gain16X Uses

func WithTSL2561Gain16X(c Config)

WithTSL2561Gain16X option sets the TSL2561Driver gain to 16X

func WithTSL2561Gain1X Uses

func WithTSL2561Gain1X(c Config)

WithTSL2561Gain1X option sets the TSL2561Driver gain to 1X

func WithTSL2561IntegrationTime101MS Uses

func WithTSL2561IntegrationTime101MS(c Config)

WithTSL2561IntegrationTime101MS option sets the TSL2561Driver integration time to 101ms

func WithTSL2561IntegrationTime13MS Uses

func WithTSL2561IntegrationTime13MS(c Config)

WithTSL2561IntegrationTime13MS option sets the TSL2561Driver integration time to 13ms

func WithTSL2561IntegrationTime402MS Uses

func WithTSL2561IntegrationTime402MS(c Config)

WithTSL2561IntegrationTime402MS option sets the TSL2561Driver integration time to 402ms

type ADS1x15Driver Uses

type ADS1x15Driver struct {
    DefaultGain     int
    DefaultDataRate int
    Config
    // contains filtered or unexported fields
}

ADS1x15Driver is the Gobot driver for the ADS1015/ADS1115 ADC

func NewADS1015Driver Uses

func NewADS1015Driver(a Connector, options ...func(Config)) *ADS1x15Driver

NewADS1015Driver creates a new driver for the ADS1015 (12-bit ADC) Largely inspired by: https://github.com/adafruit/Adafruit_Python_ADS1x15

func NewADS1115Driver Uses

func NewADS1115Driver(a Connector, options ...func(Config)) *ADS1x15Driver

NewADS1115Driver creates a new driver for the ADS1115 (16-bit ADC)

func (*ADS1x15Driver) AnalogRead Uses

func (d *ADS1x15Driver) AnalogRead(pin string) (value int, err error)

AnalogRead returns value from analog reading of specified pin

func (*ADS1x15Driver) BestGainForVoltage Uses

func (d *ADS1x15Driver) BestGainForVoltage(voltage float64) (bestGain int, err error)

BestGainForVoltage returns the gain the most adapted to read up to the specified difference of potential.

func (*ADS1x15Driver) Connection Uses

func (d *ADS1x15Driver) Connection() gobot.Connection

Connection returns the connection for the Driver

func (*ADS1x15Driver) Halt Uses

func (d *ADS1x15Driver) Halt() (err error)

Halt returns true if devices is halted successfully

func (*ADS1x15Driver) Name Uses

func (d *ADS1x15Driver) Name() string

Name returns the Name for the Driver

func (*ADS1x15Driver) Read Uses

func (d *ADS1x15Driver) Read(channel int, gain int, dataRate int) (value float64, err error)

Read reads the voltage at the specified channel (between 0 and 3). The result is in V.

func (*ADS1x15Driver) ReadDifference Uses

func (d *ADS1x15Driver) ReadDifference(diff int, gain int, dataRate int) (value float64, err error)

ReadDifference reads the difference in V between 2 inputs. diff can be: * 0: Channel 0 - channel 1 * 1: Channel 0 - channel 3 * 2: Channel 1 - channel 3 * 3: Channel 2 - channel 3

func (*ADS1x15Driver) ReadDifferenceWithDefaults Uses

func (d *ADS1x15Driver) ReadDifferenceWithDefaults(diff int) (value float64, err error)

ReadDifferenceWithDefaults reads the difference in V between 2 inputs. It uses the default gain and data rate diff can be: * 0: Channel 0 - channel 1 * 1: Channel 0 - channel 3 * 2: Channel 1 - channel 3 * 3: Channel 2 - channel 3

func (*ADS1x15Driver) ReadWithDefaults Uses

func (d *ADS1x15Driver) ReadWithDefaults(channel int) (value float64, err error)

ReadWithDefaults reads the voltage at the specified channel (between 0 and 3). Default values are used for the gain and data rate. The result is in V.

func (*ADS1x15Driver) SetName Uses

func (d *ADS1x15Driver) SetName(n string)

SetName sets the Name for the Driver

func (*ADS1x15Driver) Start Uses

func (d *ADS1x15Driver) Start() (err error)

Start initializes the sensor

type ADXL345Driver Uses

type ADXL345Driver struct {
    Config
    // contains filtered or unexported fields
}

ADXL345Driver is the gobot driver for the digital accelerometer ADXL345

Datasheet EN: http://www.analog.com/media/en/technical-documentation/data-sheets/ADXL345.pdf Datasheet JP: http://www.analog.com/media/jp/technical-documentation/data-sheets/ADXL345_jp.pdf

Ported from the Arduino driver https://github.com/jakalada/Arduino-ADXL345

func NewADXL345Driver Uses

func NewADXL345Driver(a Connector, options ...func(Config)) *ADXL345Driver

NewADXL345Driver creates a new driver with specified i2c interface Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

func (*ADXL345Driver) Connection Uses

func (h *ADXL345Driver) Connection() gobot.Connection

Connection returns the connection for the Driver

func (*ADXL345Driver) Halt Uses

func (h *ADXL345Driver) Halt() (err error)

Halt returns true if devices is halted successfully

func (*ADXL345Driver) Name Uses

func (h *ADXL345Driver) Name() string

Name returns the Name for the Driver

func (*ADXL345Driver) RawXYZ Uses

func (h *ADXL345Driver) RawXYZ() (int16, int16, int16, error)

XYZ returns the raw x,y and z axis from the adxl345

func (*ADXL345Driver) SetName Uses

func (h *ADXL345Driver) SetName(n string)

SetName sets the Name for the Driver

func (*ADXL345Driver) SetRange Uses

func (h *ADXL345Driver) SetRange(sensorRange byte) (err error)

SetRange change the current range of the sensor

func (*ADXL345Driver) SetRate Uses

func (h *ADXL345Driver) SetRate(rate byte) (err error)

SetRate change the current rate of the sensor

func (*ADXL345Driver) Start Uses

func (h *ADXL345Driver) Start() (err error)

Start initialized the adxl345

func (*ADXL345Driver) Stop Uses

func (h *ADXL345Driver) Stop() (err error)

Stop adxl345

func (*ADXL345Driver) UseLowPower Uses

func (h *ADXL345Driver) UseLowPower(power bool) (err error)

SetRate change the current rate of the sensor

func (*ADXL345Driver) XYZ Uses

func (h *ADXL345Driver) XYZ() (float64, float64, float64, error)

XYZ returns the adjusted x, y and z axis from the adxl345

type AdafruitDirection Uses

type AdafruitDirection int

AdafruitDirection declares a type for specification of the motor direction

const (
    AdafruitForward  AdafruitDirection = iota // 0
    AdafruitBackward                          // 1
    AdafruitRelease                           // 2
)

type AdafruitMotorHatDriver Uses

type AdafruitMotorHatDriver struct {
    Config
    gobot.Commander
    // contains filtered or unexported fields
}

AdafruitMotorHatDriver is a driver for the DC+Stepper Motor HAT from Adafruit. The HAT is a Raspberry Pi add-on that can drive up to 4 DC or 2 Stepper motors with full PWM speed control. It has a dedicated PWM driver chip onboard to control both motor direction and speed over I2C.

func NewAdafruitMotorHatDriver Uses

func NewAdafruitMotorHatDriver(conn Connector, options ...func(Config)) *AdafruitMotorHatDriver

NewAdafruitMotorHatDriver initializes the internal DCMotor and StepperMotor types. Again the Adafruit Motor Hat supports up to four DC motors and up to two stepper motors. Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

func (*AdafruitMotorHatDriver) Connection Uses

func (a *AdafruitMotorHatDriver) Connection() gobot.Connection

Connection identifies the particular adapter object

func (*AdafruitMotorHatDriver) Halt Uses

func (a *AdafruitMotorHatDriver) Halt() (err error)

Halt returns true if devices is halted successfully

func (*AdafruitMotorHatDriver) Name Uses

func (a *AdafruitMotorHatDriver) Name() string

Name identifies this driver object

func (*AdafruitMotorHatDriver) RunDCMotor Uses

func (a *AdafruitMotorHatDriver) RunDCMotor(dcMotor int, dir AdafruitDirection) (err error)

RunDCMotor will set the appropriate pins to run the specified DC motor for the given direction

func (*AdafruitMotorHatDriver) SetDCMotorSpeed Uses

func (a *AdafruitMotorHatDriver) SetDCMotorSpeed(dcMotor int, speed int32) (err error)

SetDCMotorSpeed will set the appropriate pins to run the specified DC motor for the given speed.

func (*AdafruitMotorHatDriver) SetMotorHatAddress Uses

func (a *AdafruitMotorHatDriver) SetMotorHatAddress(addr int) (err error)

SetMotorHatAddress sets the I2C address for the DC and Stepper Motor HAT. This addressing flexibility empowers "stacking" the HATs.

func (*AdafruitMotorHatDriver) SetName Uses

func (a *AdafruitMotorHatDriver) SetName(n string)

SetName sets nae for driver

func (*AdafruitMotorHatDriver) SetServoHatAddress Uses

func (a *AdafruitMotorHatDriver) SetServoHatAddress(addr int) (err error)

SetServoHatAddress sets the I2C address for the PWM-Servo Motor HAT. This addressing flexibility empowers "stacking" the HATs.

func (*AdafruitMotorHatDriver) SetServoMotorFreq Uses

func (a *AdafruitMotorHatDriver) SetServoMotorFreq(freq float64) (err error)

SetServoMotorFreq sets the frequency for the currently addressed PWM Servo HAT.

func (*AdafruitMotorHatDriver) SetServoMotorPulse Uses

func (a *AdafruitMotorHatDriver) SetServoMotorPulse(channel byte, on, off int32) (err error)

SetServoMotorPulse is a convenience function to specify the 'tick' value, between 0-4095, when the signal will turn on, and when it will turn off.

func (*AdafruitMotorHatDriver) SetStepperMotorSpeed Uses

func (a *AdafruitMotorHatDriver) SetStepperMotorSpeed(stepperMotor int, rpm int) (err error)

SetStepperMotorSpeed sets the seconds-per-step for the given Stepper Motor.

func (*AdafruitMotorHatDriver) Start Uses

func (a *AdafruitMotorHatDriver) Start() (err error)

Start initializes both I2C-addressable Adafruit Motor HAT drivers

func (*AdafruitMotorHatDriver) Step Uses

func (a *AdafruitMotorHatDriver) Step(motor, steps int, dir AdafruitDirection, style AdafruitStepStyle) (err error)

Step will rotate the stepper motor the given number of steps, in the given direction and step style.

type AdafruitStepStyle Uses

type AdafruitStepStyle int

AdafruitStepStyle declares a type for specification of the stepper motor rotation

const (
    AdafruitSingle     AdafruitStepStyle = iota // 0
    AdafruitDouble                              // 1
    AdafruitInterleave                          // 2
    AdafruitMicrostep                           // 3
)

type BH1750Driver Uses

type BH1750Driver struct {
    Config
    // contains filtered or unexported fields
}

BH1750Driver is a driver for the BH1750 digital Ambient Light Sensor IC for I²C bus interface.

func NewBH1750Driver Uses

func NewBH1750Driver(a Connector, options ...func(Config)) *BH1750Driver

NewBH1750Driver creates a new driver with specified i2c interface Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

func (*BH1750Driver) Connection Uses

func (h *BH1750Driver) Connection() gobot.Connection

Connection returns the connection for the Driver

func (*BH1750Driver) Halt Uses

func (h *BH1750Driver) Halt() (err error)

Halt returns true if devices is halted successfully

func (*BH1750Driver) Lux Uses

func (h *BH1750Driver) Lux() (lux int, err error)

Lux returns the adjusted value from the bh1750

func (*BH1750Driver) Name Uses

func (h *BH1750Driver) Name() string

Name returns the Name for the Driver

func (*BH1750Driver) RawSensorData Uses

func (h *BH1750Driver) RawSensorData() (level int, err error)

RawSensorData returns the raw value from the bh1750

func (*BH1750Driver) SetName Uses

func (h *BH1750Driver) SetName(n string)

SetName sets the Name for the Driver

func (*BH1750Driver) Start Uses

func (h *BH1750Driver) Start() (err error)

Start initialized the bh1750

type BME280Driver Uses

type BME280Driver struct {
    *BMP280Driver
    // contains filtered or unexported fields
}

BME280Driver is a driver for the BME280 temperature/humidity sensor. It implements all of the same functions as the BMP280Driver, but also adds the Humidity() function by reading the BME280's humidity sensor. For details on the BMP280Driver please see:

https://godoc.org/gobot.io/x/gobot/drivers/i2c#BMP280Driver

func NewBME280Driver Uses

func NewBME280Driver(c Connector, options ...func(Config)) *BME280Driver

NewBME280Driver creates a new driver with specified i2c interface. Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

func (*BME280Driver) Humidity Uses

func (d *BME280Driver) Humidity() (humidity float32, err error)

Humidity returns the current humidity in percentage of relative humidity

func (*BME280Driver) Start Uses

func (d *BME280Driver) Start() (err error)

Start initializes the BME280 and loads the calibration coefficients.

type BMP180Driver Uses

type BMP180Driver struct {
    Mode BMP180OversamplingMode

    Config
    // contains filtered or unexported fields
}

BMP180Driver is the gobot driver for the Bosch pressure sensor BMP180. Device datasheet: https://cdn-shop.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf

func NewBMP180Driver Uses

func NewBMP180Driver(c Connector, options ...func(Config)) *BMP180Driver

NewBMP180Driver creates a new driver with the i2c interface for the BMP180 device. Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

func (*BMP180Driver) Connection Uses

func (d *BMP180Driver) Connection() gobot.Connection

Connection returns the connection of the device.

func (*BMP180Driver) Halt Uses

func (d *BMP180Driver) Halt() (err error)

Halt halts the device.

func (*BMP180Driver) Name Uses

func (d *BMP180Driver) Name() string

Name returns the name of the device.

func (*BMP180Driver) Pressure Uses

func (d *BMP180Driver) Pressure() (pressure float32, err error)

Pressure returns the current pressure, in pascals.

func (*BMP180Driver) SetName Uses

func (d *BMP180Driver) SetName(n string)

SetName sets the name of the device.

func (*BMP180Driver) Start Uses

func (d *BMP180Driver) Start() (err error)

Start initializes the BMP180 and loads the calibration coefficients.

func (*BMP180Driver) Temperature Uses

func (d *BMP180Driver) Temperature() (temp float32, err error)

Temperature returns the current temperature, in celsius degrees.

type BMP180OversamplingMode Uses

type BMP180OversamplingMode uint

BMP180OversamplingMode is the oversampling ratio of the pressure measurement.

const (
    // BMP180UltraLowPower is the lowest oversampling mode of the pressure measurement.
    BMP180UltraLowPower BMP180OversamplingMode = iota
    // BMP180Standard is the standard oversampling mode of the pressure measurement.
    BMP180Standard
    // BMP180HighResolution is a high oversampling mode of the pressure measurement.
    BMP180HighResolution
    // BMP180UltraHighResolution is the highest oversampling mode of the pressure measurement.
    BMP180UltraHighResolution
)

type BMP280Driver Uses

type BMP280Driver struct {
    Config
    // contains filtered or unexported fields
}

BMP280Driver is a driver for the BMP280 temperature/pressure sensor

func NewBMP280Driver Uses

func NewBMP280Driver(c Connector, options ...func(Config)) *BMP280Driver

NewBMP280Driver creates a new driver with specified i2c interface. Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

func (*BMP280Driver) Altitude Uses

func (d *BMP280Driver) Altitude() (alt float32, err error)

Altitude returns the current altitude in meters based on the current barometric pressure and estimated pressure at sea level. Calculation is based on code from Adafruit BME280 library

https://github.com/adafruit/Adafruit_BME280_Library

func (*BMP280Driver) Connection Uses

func (d *BMP280Driver) Connection() gobot.Connection

Connection returns the connection of the device.

func (*BMP280Driver) Halt Uses

func (d *BMP280Driver) Halt() (err error)

Halt halts the device.

func (*BMP280Driver) Name Uses

func (d *BMP280Driver) Name() string

Name returns the name of the device.

func (*BMP280Driver) Pressure Uses

func (d *BMP280Driver) Pressure() (press float32, err error)

Pressure returns the current barometric pressure, in Pa

func (*BMP280Driver) SetName Uses

func (d *BMP280Driver) SetName(n string)

SetName sets the name of the device.

func (*BMP280Driver) Start Uses

func (d *BMP280Driver) Start() (err error)

Start initializes the BMP280 and loads the calibration coefficients.

func (*BMP280Driver) Temperature Uses

func (d *BMP280Driver) Temperature() (temp float32, err error)

Temperature returns the current temperature, in celsius degrees.

type BlinkMDriver Uses

type BlinkMDriver struct {
    Config
    gobot.Commander
    // contains filtered or unexported fields
}

BlinkMDriver is a Gobot Driver for a BlinkM LED

func NewBlinkMDriver Uses

func NewBlinkMDriver(a Connector, options ...func(Config)) *BlinkMDriver

NewBlinkMDriver creates a new BlinkMDriver.

Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

func (*BlinkMDriver) Color Uses

func (b *BlinkMDriver) Color() (color []byte, err error)

Color returns an array with current rgb color

func (*BlinkMDriver) Connection Uses

func (b *BlinkMDriver) Connection() gobot.Connection

Connection returns the connection for the Driver

func (*BlinkMDriver) Fade Uses

func (b *BlinkMDriver) Fade(red byte, green byte, blue byte) (err error)

Fade removes color using r,g,b params

func (*BlinkMDriver) FirmwareVersion Uses

func (b *BlinkMDriver) FirmwareVersion() (version string, err error)

FirmwareVersion returns version with MAYOR.minor format

func (*BlinkMDriver) Halt Uses

func (b *BlinkMDriver) Halt() (err error)

Halt returns true if device is halted successfully

func (*BlinkMDriver) Name Uses

func (b *BlinkMDriver) Name() string

Name returns the Name for the Driver

func (*BlinkMDriver) Rgb Uses

func (b *BlinkMDriver) Rgb(red byte, green byte, blue byte) (err error)

Rgb sets color using r,g,b params

func (*BlinkMDriver) SetName Uses

func (b *BlinkMDriver) SetName(n string)

SetName sets the Name for the Driver

func (*BlinkMDriver) Start Uses

func (b *BlinkMDriver) Start() (err error)

Start starts the Driver up, and writes start command

type Config Uses

type Config interface {
    // WithBus sets which bus to use
    WithBus(bus int)

    // GetBusOrDefault gets which bus to use
    GetBusOrDefault(def int) int

    // WithAddress sets which address to use
    WithAddress(address int)

    // GetAddressOrDefault gets which address to use
    GetAddressOrDefault(def int) int
}

Config is the interface which describes how a Driver can specify optional I2C params such as which I2C bus it wants to use.

func NewConfig Uses

func NewConfig() Config

NewConfig returns a new I2c Config.

type Connection Uses

type Connection I2cOperations

Connection is a connection to an I2C device with a specified address on a specific bus. Used as an alternative to the I2c interface. Implements I2cOperations to talk to the device, wrapping the calls in SetAddress to always target the specified device. Provided by an Adaptor by implementing the I2cConnector interface.

type Connector Uses

type Connector interface {
    // GetConnection returns a connection to device at the specified address
    // and bus. Bus numbering starts at index 0, the range of valid buses is
    // platform specific.
    GetConnection(address int, bus int) (device Connection, err error)

    // GetDefaultBus returns the default I2C bus index
    GetDefaultBus() int
}

Connector lets Adaptors provide the interface for Drivers to get access to the I2C buses on platforms that support I2C.

type DRV2605LDriver Uses

type DRV2605LDriver struct {
    Config
    // contains filtered or unexported fields
}

DRV2605LDriver is the gobot driver for the TI/Adafruit DRV2605L Haptic Controller

Device datasheet: http://www.ti.com/lit/ds/symlink/drv2605l.pdf

Inspired by the Adafruit Python driver by Sean Mealin.

Basic use:

haptic := i2c.NewDRV2605Driver(adaptor)
haptic.SetSequence([]byte{1, 13})
haptic.Go()

func NewDRV2605LDriver Uses

func NewDRV2605LDriver(conn Connector, options ...func(Config)) *DRV2605LDriver

NewDRV2605LDriver creates a new driver for the DRV2605L device.

Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

func (*DRV2605LDriver) Connection Uses

func (d *DRV2605LDriver) Connection() gobot.Connection

Connection returns the connection of the device.

func (*DRV2605LDriver) GetPauseWaveform Uses

func (d *DRV2605LDriver) GetPauseWaveform(delayTime10MS uint8) (pauseID uint8)

GetPauseWaveform returns a special waveform ID used in SetSequence() to encode pauses between waveforms. Time is specified in tens of milliseconds ranging from 0ms (delayTime10MS = 0) to 1270ms (delayTime10MS = 127). Times out of range are clipped to fit.

func (*DRV2605LDriver) Go Uses

func (d *DRV2605LDriver) Go() (err error)

Go plays the current sequence of waveforms.

func (*DRV2605LDriver) Halt Uses

func (d *DRV2605LDriver) Halt() (err error)

Halt halts the device.

func (*DRV2605LDriver) Name Uses

func (d *DRV2605LDriver) Name() string

Name returns the name of the device.

func (*DRV2605LDriver) SelectLibrary Uses

func (d *DRV2605LDriver) SelectLibrary(library uint8) (err error)

SelectLibrary selects which waveform library to play from, 1-7. See datasheet for more info.

func (*DRV2605LDriver) SetMode Uses

func (d *DRV2605LDriver) SetMode(newMode DRV2605Mode) (err error)

SetMode sets the device in one of the eight modes as described in the datasheet. Defaults to mode 0, internal trig.

func (*DRV2605LDriver) SetName Uses

func (d *DRV2605LDriver) SetName(name string)

SetName sets the name of the device.

func (*DRV2605LDriver) SetSequence Uses

func (d *DRV2605LDriver) SetSequence(waveforms []uint8) (err error)

SetSequence sets the sequence of waveforms to be played by the sequencer, specified by waveform id as described in the datasheet. The sequencer can play at most 8 waveforms in sequence, longer sequences will be truncated. A waveform id of zero marks the end of the sequence. Pauses can be encoded using GetPauseWaveform().

func (*DRV2605LDriver) SetStandbyMode Uses

func (d *DRV2605LDriver) SetStandbyMode(standby bool) (err error)

SetStandbyMode controls device low power mode

func (*DRV2605LDriver) Start Uses

func (d *DRV2605LDriver) Start() (err error)

Start initializes the device.

type DRV2605Mode Uses

type DRV2605Mode uint8

DRV2605Mode - operating mode

type DisplayBuffer Uses

type DisplayBuffer struct {
    Width, Height int
    // contains filtered or unexported fields
}

DisplayBuffer represents the display buffer intermediate memory

func NewDisplayBuffer Uses

func NewDisplayBuffer(Width, Height int) *DisplayBuffer

NewDisplayBuffer creates a new DisplayBuffer

func (*DisplayBuffer) Clear Uses

func (s *DisplayBuffer) Clear()

Clear the contents of the display buffer

func (*DisplayBuffer) Set Uses

func (s *DisplayBuffer) Set(x, y, c int)

Set sets the x, y pixel with c color

func (*DisplayBuffer) Size Uses

func (s *DisplayBuffer) Size() int

Size returns the memory size of the display buffer

type GroveAccelerometerDriver Uses

type GroveAccelerometerDriver struct {
    *MMA7660Driver
}

GroveAccelerometerDriver is a driver for the MMA7660 accelerometer

func NewGroveAccelerometerDriver Uses

func NewGroveAccelerometerDriver(a Connector, options ...func(Config)) *GroveAccelerometerDriver

NewGroveAccelerometerDriver creates a new driver with specified i2c interface Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

type GroveLcdDriver Uses

type GroveLcdDriver struct {
    *JHD1313M1Driver
}

GroveLcdDriver is a driver for the Jhd1313m1 LCD display which has two i2c addreses, one belongs to a controller and the other controls solely the backlight. This module was tested with the Seed Grove LCD RGB Backlight v2.0 display which requires 5V to operate. http://www.seeedstudio.com/wiki/Grove_-_LCD_RGB_Backlight

func NewGroveLcdDriver Uses

func NewGroveLcdDriver(a Connector, options ...func(Config)) *GroveLcdDriver

NewGroveLcdDriver creates a new driver with specified i2c interface. Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

type HMC6352Driver Uses

type HMC6352Driver struct {
    Config
    // contains filtered or unexported fields
}

HMC6352Driver is a Driver for a HMC6352 digital compass

func NewHMC6352Driver Uses

func NewHMC6352Driver(a Connector, options ...func(Config)) *HMC6352Driver

NewHMC6352Driver creates a new driver with specified i2c interface Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

func (*HMC6352Driver) Connection Uses

func (h *HMC6352Driver) Connection() gobot.Connection

Connection returns the connection for this Driver

func (*HMC6352Driver) Halt Uses

func (h *HMC6352Driver) Halt() (err error)

Halt returns true if devices is halted successfully

func (*HMC6352Driver) Heading Uses

func (h *HMC6352Driver) Heading() (heading uint16, err error)

Heading returns the current heading

func (*HMC6352Driver) Name Uses

func (h *HMC6352Driver) Name() string

Name returns the name for this Driver

func (*HMC6352Driver) SetName Uses

func (h *HMC6352Driver) SetName(n string)

SetName sets the name for this Driver

func (*HMC6352Driver) Start Uses

func (h *HMC6352Driver) Start() (err error)

Start initializes the hmc6352

type I2cDevice Uses

type I2cDevice interface {
    I2cOperations
    SetAddress(int) error
}

I2cDevice is the interface to a specific i2c bus

type I2cOperations Uses

type I2cOperations interface {
    io.ReadWriteCloser
    ReadByte() (val byte, err error)
    ReadByteData(reg uint8) (val uint8, err error)
    ReadWordData(reg uint8) (val uint16, err error)
    WriteByte(val byte) (err error)
    WriteByteData(reg uint8, val uint8) (err error)
    WriteWordData(reg uint8, val uint16) (err error)
    WriteBlockData(reg uint8, b []byte) (err error)
}

type INA3221Channel Uses

type INA3221Channel uint8

INA3221Channel type that defines which INA3221 channel to read from.

const (
    INA3221Channel1 INA3221Channel = 1
    INA3221Channel2 INA3221Channel = 2
    INA3221Channel3 INA3221Channel = 3
)

type INA3221Driver Uses

type INA3221Driver struct {
    Config
    // contains filtered or unexported fields
}

INA3221Driver is a driver for the INA3221 three-channel current and bus voltage monitoring device.

func NewINA3221Driver Uses

func NewINA3221Driver(c Connector, options ...func(Config)) *INA3221Driver

NewINA3221Driver creates a new driver with the specified i2c interface. Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):		bus to use with this driver
i2c.WithAddress(int):		address to use with this driver

func (*INA3221Driver) Connection Uses

func (i *INA3221Driver) Connection() gobot.Connection

Connection returns the connection of the device.

func (*INA3221Driver) GetBusVoltage Uses

func (i *INA3221Driver) GetBusVoltage(channel INA3221Channel) (float64, error)

GetBusVoltage gets the bus voltage in Volts

func (*INA3221Driver) GetCurrent Uses

func (i *INA3221Driver) GetCurrent(channel INA3221Channel) (float64, error)

GetCurrent gets the current value in mA, taking into account the config settings and current LSB

func (*INA3221Driver) GetLoadVoltage Uses

func (i *INA3221Driver) GetLoadVoltage(channel INA3221Channel) (float64, error)

GetLoadVoltage gets the load voltage in mV

func (*INA3221Driver) GetShuntVoltage Uses

func (i *INA3221Driver) GetShuntVoltage(channel INA3221Channel) (float64, error)

GetShuntVoltage Gets the shunt voltage in mV

func (*INA3221Driver) Halt Uses

func (i *INA3221Driver) Halt() error

Halt halts the device.

func (*INA3221Driver) Name Uses

func (i *INA3221Driver) Name() string

Name returns the name of the device.

func (*INA3221Driver) SetName Uses

func (i *INA3221Driver) SetName(name string)

SetName sets the name of the device.

func (*INA3221Driver) Start Uses

func (i *INA3221Driver) Start() error

Start initializes the INA3221

type JHD1313M1Driver Uses

type JHD1313M1Driver struct {
    Config
    // contains filtered or unexported fields
}

JHD1313M1Driver is a driver for the Jhd1313m1 LCD display which has two i2c addreses, one belongs to a controller and the other controls solely the backlight. This module was tested with the Seed Grove LCD RGB Backlight v2.0 display which requires 5V to operate. http://www.seeedstudio.com/wiki/Grove_-_LCD_RGB_Backlight

func NewJHD1313M1Driver Uses

func NewJHD1313M1Driver(a Connector, options ...func(Config)) *JHD1313M1Driver

NewJHD1313M1Driver creates a new driver with specified i2c interface. Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver

func (*JHD1313M1Driver) Clear Uses

func (h *JHD1313M1Driver) Clear() error

Clear clears the text on the lCD display.

func (*JHD1313M1Driver) Connection Uses

func (h *JHD1313M1Driver) Connection() gobot.Connection

Connection returns the driver connection to the device.

func (*JHD1313M1Driver) Halt Uses

func (h *JHD1313M1Driver) Halt() error

Halt is a noop function.

func (*JHD1313M1Driver) Home Uses

func (h *JHD1313M1Driver) Home() error

Home sets the cursor to the origin position on the display.

func (*JHD1313M1Driver) Name Uses

func (h *JHD1313M1Driver) Name() string

Name returns the name the JHD1313M1 Driver was given when created.

func (*JHD1313M1Driver) Scroll Uses

func (h *JHD1313M1Driver) Scroll(leftToRight bool) error

func (*JHD1313M1Driver) SetCustomChar Uses

func (h *JHD1313M1Driver) SetCustomChar(pos int, charMap [8]byte) error

SetCustomChar sets one of the 8 CGRAM locations with a custom character. The custom character can be used by writing a byte of value 0 to 7. When you are using LCD as 5x8 dots in function set then you can define a total of 8 user defined patterns (1 Byte for each row and 8 rows for each pattern). Use http://www.8051projects.net/lcd-interfacing/lcd-custom-character.php to create your own characters. To use a custom character, write byte value of the custom character position as a string after having setup the custom character.

func (*JHD1313M1Driver) SetName Uses

func (h *JHD1313M1Driver) SetName(n string)

SetName sets the name for the JHD1313M1 Driver.

func (*JHD1313M1Driver) SetPosition Uses

func (h *JHD1313M1Driver) SetPosition(pos int) (err error)

SetPosition sets the cursor and the data display to pos. 0..15 are the positions in the first display line. 16..32 are the positions in the second display line.

func (*JHD1313M1Driver) SetRGB Uses

func (h *JHD1313M1Driver) SetRGB(r, g, b int) error

SetRGB sets the Red Green Blue value of backlit.

func (*JHD1313M1Driver) Start Uses

func (h *JHD1313M1Driver) Start() (err error)

Start starts the backlit and the screen and initializes the states.

func (*JHD1313M1Driver) Write Uses

func (h *JHD1313M1Driver) Write(message string) error

Write displays the passed message on the screen.

type L3GD20HDriver Uses

type L3GD20HDriver struct {
    Config
    // contains filtered or unexported fields
}

L3GD20HDriver is the gobot driver for the Adafruit Triple-Axis Gyroscope L3GD20H. Device datasheet: http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/DM00036465.pdf

func NewL3GD20HDriver Uses

func NewL3GD20HDriver(c Connector, options ...func(Config)) *L3GD20HDriver

NewL3GD20HDriver creates a new Gobot driver for the L3GD20H I2C Triple-Axis Gyroscope.

Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

func (*L3GD20HDriver) Connection Uses

func (d *L3GD20HDriver) Connection() gobot.Connection

Connection returns the connection of the device.

func (*L3GD20HDriver) Halt Uses

func (d *L3GD20HDriver) Halt() (err error)

Halt halts the device.

func (*L3GD20HDriver) Name Uses

func (d *L3GD20HDriver) Name() string

Name returns the name of the device.

func (*L3GD20HDriver) Scale Uses

func (d *L3GD20HDriver) Scale() L3GD20HScale

Scale returns the scale sensitivity of the device.

func (*L3GD20HDriver) SetName Uses

func (d *L3GD20HDriver) SetName(name string)

SetName sets the name of the device.

func (*L3GD20HDriver) SetScale Uses

func (d *L3GD20HDriver) SetScale(s L3GD20HScale)

SetScale sets the scale sensitivity of the device.

func (*L3GD20HDriver) Start Uses

func (d *L3GD20HDriver) Start() (err error)

Start initializes the device.

func (*L3GD20HDriver) XYZ Uses

func (d *L3GD20HDriver) XYZ() (x float32, y float32, z float32, err error)

XYZ returns the current change in degrees per second, for the 3 axis.

type L3GD20HScale Uses

type L3GD20HScale byte

L3GD20HScale is the scale sensitivity of degrees-per-second.

const (
    // L3GD20HScale250dps is the 250 degress-per-second scale.
    L3GD20HScale250dps L3GD20HScale = 0x00
    // L3GD20HScale500dps is the 500 degress-per-second scale.
    L3GD20HScale500dps L3GD20HScale = 0x10
    // L3GD20HScale2000dps is the 2000 degress-per-second scale.
    L3GD20HScale2000dps L3GD20HScale = 0x30
)

type LIDARLiteDriver Uses

type LIDARLiteDriver struct {
    Config
    // contains filtered or unexported fields
}

LIDARLiteDriver is the Gobot driver for the LIDARLite I2C LIDAR device.

func NewLIDARLiteDriver Uses

func NewLIDARLiteDriver(a Connector, options ...func(Config)) *LIDARLiteDriver

NewLIDARLiteDriver creates a new driver for the LIDARLite I2C LIDAR device.

Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

func (*LIDARLiteDriver) Connection Uses

func (h *LIDARLiteDriver) Connection() gobot.Connection

Connection returns the connection for the Driver

func (*LIDARLiteDriver) Distance Uses

func (h *LIDARLiteDriver) Distance() (distance int, err error)

Distance returns the current distance in cm

func (*LIDARLiteDriver) Halt Uses

func (h *LIDARLiteDriver) Halt() (err error)

Halt returns true if devices is halted successfully

func (*LIDARLiteDriver) Name Uses

func (h *LIDARLiteDriver) Name() string

Name returns the Name for the Driver

func (*LIDARLiteDriver) SetName Uses

func (h *LIDARLiteDriver) SetName(n string)

SetName sets the Name for the Driver

func (*LIDARLiteDriver) Start Uses

func (h *LIDARLiteDriver) Start() (err error)

Start initialized the LIDAR

type MCP23017Config Uses

type MCP23017Config struct {
    Bank   uint8
    Mirror uint8
    Seqop  uint8
    Disslw uint8
    Haen   uint8
    Odr    uint8
    Intpol uint8
}

MCP23017Config contains the device configuration for the IOCON register. These fields should only be set with values 0 or 1.

type MCP23017Driver Uses

type MCP23017Driver struct {
    Config
    MCPConf MCP23017Config
    gobot.Commander
    gobot.Eventer
    // contains filtered or unexported fields
}

MCP23017Driver contains the driver configuration parameters.

func NewMCP23017Driver Uses

func NewMCP23017Driver(a Connector, options ...func(Config)) *MCP23017Driver

NewMCP23017Driver creates a new Gobot Driver to the MCP23017 i2c port expander. Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver
i2c.WithMCP23017Bank(int):	MCP23017 bank to use with this driver
i2c.WithMCP23017Mirror(int):	MCP23017 mirror to use with this driver
i2c.WithMCP23017Seqop(int):	MCP23017 seqop to use with this driver
i2c.WithMCP23017Disslw(int):	MCP23017 disslw to use with this driver
i2c.WithMCP23017Haen(int):	MCP23017 haen to use with this driver
i2c.WithMCP23017Odr(int):	MCP23017 odr to use with this driver
i2c.WithMCP23017Intpol(int):	MCP23017 intpol to use with this driver

func (*MCP23017Driver) Connection Uses

func (m *MCP23017Driver) Connection() gobot.Connection

Connection returns the I2c connection.

func (*MCP23017Driver) Halt Uses

func (m *MCP23017Driver) Halt() (err error)

Halt stops the driver.

func (*MCP23017Driver) Name Uses

func (m *MCP23017Driver) Name() string

Name return the driver name.

func (*MCP23017Driver) ReadGPIO Uses

func (m *MCP23017Driver) ReadGPIO(pin uint8, portStr string) (val uint8, err error)

ReadGPIO reads a value from a given gpio pin (0-7) and a port (A or B).

func (*MCP23017Driver) SetGPIOPolarity Uses

func (m *MCP23017Driver) SetGPIOPolarity(pin uint8, val uint8, portStr string) (err error)

SetGPIOPolarity will change a given pin's polarity based on the value: val = 1 opposite logic state of the input pin. val = 0 same logic state of the input pin.

func (*MCP23017Driver) SetName Uses

func (m *MCP23017Driver) SetName(n string)

SetName set the driver name.

func (*MCP23017Driver) SetPullUp Uses

func (m *MCP23017Driver) SetPullUp(pin uint8, val uint8, portStr string) error

SetPullUp sets the pull up state of a given pin based on the value: val = 1 pull up enabled. val = 0 pull up disabled.

func (*MCP23017Driver) Start Uses

func (m *MCP23017Driver) Start() (err error)

Start writes the device configuration.

func (*MCP23017Driver) WriteGPIO Uses

func (m *MCP23017Driver) WriteGPIO(pin uint8, val uint8, portStr string) (err error)

WriteGPIO writes a value to a gpio pin (0-7) and a port (A or B).

type MMA7660Driver Uses

type MMA7660Driver struct {
    Config
    // contains filtered or unexported fields
}

func NewMMA7660Driver Uses

func NewMMA7660Driver(a Connector, options ...func(Config)) *MMA7660Driver

NewMMA7660Driver creates a new driver with specified i2c interface Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

func (*MMA7660Driver) Acceleration Uses

func (h *MMA7660Driver) Acceleration(x, y, z float64) (ax, ay, az float64)

Acceleration returns the acceleration of the provided x, y, z

func (*MMA7660Driver) Connection Uses

func (h *MMA7660Driver) Connection() gobot.Connection

Connection returns the connection for the Driver

func (*MMA7660Driver) Halt Uses

func (h *MMA7660Driver) Halt() (err error)

Halt returns true if devices is halted successfully

func (*MMA7660Driver) Name Uses

func (h *MMA7660Driver) Name() string

Name returns the Name for the Driver

func (*MMA7660Driver) SetName Uses

func (h *MMA7660Driver) SetName(n string)

SetName sets the Name for the Driver

func (*MMA7660Driver) Start Uses

func (h *MMA7660Driver) Start() (err error)

Start initialized the mma7660

func (*MMA7660Driver) XYZ Uses

func (h *MMA7660Driver) XYZ() (x float64, y float64, z float64, err error)

XYZ returns the raw x,y and z axis from the mma7660

type MPL115A2Driver Uses

type MPL115A2Driver struct {
    Config
    gobot.Eventer
    A0  float32
    B1  float32
    B2  float32
    C12 float32
    // contains filtered or unexported fields
}

MPL115A2Driver is a Gobot Driver for the MPL115A2 I2C digitial pressure/temperature sensor.

func NewMPL115A2Driver Uses

func NewMPL115A2Driver(a Connector, options ...func(Config)) *MPL115A2Driver

NewMPL115A2Driver creates a new Gobot Driver for an MPL115A2 I2C Pressure/Temperature sensor.

Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

func (*MPL115A2Driver) Connection Uses

func (h *MPL115A2Driver) Connection() gobot.Connection

Connection returns the Connection of the device.

func (*MPL115A2Driver) Halt Uses

func (h *MPL115A2Driver) Halt() (err error)

Halt returns true if devices is halted successfully

func (*MPL115A2Driver) Name Uses

func (h *MPL115A2Driver) Name() string

Name returns the name of the device.

func (*MPL115A2Driver) Pressure Uses

func (h *MPL115A2Driver) Pressure() (p float32, err error)

Pressure fetches the latest data from the MPL115A2, and returns the pressure

func (*MPL115A2Driver) SetName Uses

func (h *MPL115A2Driver) SetName(n string)

SetName sets the name of the device.

func (*MPL115A2Driver) Start Uses

func (h *MPL115A2Driver) Start() (err error)

Start writes initialization bytes and reads from adaptor using specified interval to accelerometer andtemperature data

func (*MPL115A2Driver) Temperature Uses

func (h *MPL115A2Driver) Temperature() (t float32, err error)

Temperature fetches the latest data from the MPL115A2, and returns the temperature

type MPU6050Driver Uses

type MPU6050Driver struct {
    Config

    Accelerometer ThreeDData
    Gyroscope     ThreeDData
    Temperature   int16
    gobot.Eventer
    // contains filtered or unexported fields
}

MPU6050Driver is a new Gobot Driver for an MPU6050 I2C Accelerometer/Gyroscope.

func NewMPU6050Driver Uses

func NewMPU6050Driver(a Connector, options ...func(Config)) *MPU6050Driver

NewMPU6050Driver creates a new Gobot Driver for an MPU6050 I2C Accelerometer/Gyroscope.

Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

func (*MPU6050Driver) Connection Uses

func (h *MPU6050Driver) Connection() gobot.Connection

Connection returns the connection for the device.

func (*MPU6050Driver) GetData Uses

func (h *MPU6050Driver) GetData() (err error)

GetData fetches the latest data from the MPU6050

func (*MPU6050Driver) Halt Uses

func (h *MPU6050Driver) Halt() (err error)

Halt returns true if devices is halted successfully

func (*MPU6050Driver) Name Uses

func (h *MPU6050Driver) Name() string

Name returns the name of the device.

func (*MPU6050Driver) SetName Uses

func (h *MPU6050Driver) SetName(n string)

SetName sets the name of the device.

func (*MPU6050Driver) Start Uses

func (h *MPU6050Driver) Start() (err error)

Start writes initialization bytes to sensor

type PCA9685Driver Uses

type PCA9685Driver struct {
    Config
    // contains filtered or unexported fields
}

PCA9685Driver is a Gobot Driver for the PCA9685 16-channel 12-bit PWM/Servo controller.

func NewPCA9685Driver Uses

func NewPCA9685Driver(a Connector, options ...func(Config)) *PCA9685Driver

NewPCA9685Driver creates a new driver with specified i2c interface Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

func (*PCA9685Driver) Connection Uses

func (p *PCA9685Driver) Connection() gobot.Connection

Connection returns the connection for the Driver

func (*PCA9685Driver) Halt Uses

func (p *PCA9685Driver) Halt() (err error)

Halt stops the device

func (*PCA9685Driver) Name Uses

func (p *PCA9685Driver) Name() string

Name returns the Name for the Driver

func (*PCA9685Driver) PwmWrite Uses

func (p *PCA9685Driver) PwmWrite(pin string, val byte) (err error)

PwmWrite writes a PWM signal to the specified pin

func (*PCA9685Driver) ServoWrite Uses

func (p *PCA9685Driver) ServoWrite(pin string, val byte) (err error)

ServoWrite writes a servo signal to the specified pin. Valid values are from 0-180.

func (*PCA9685Driver) SetName Uses

func (p *PCA9685Driver) SetName(n string)

SetName sets the Name for the Driver

func (*PCA9685Driver) SetPWM Uses

func (p *PCA9685Driver) SetPWM(channel int, on uint16, off uint16) (err error)

SetPWM sets a specific channel to a pwm value from 0-4096

func (*PCA9685Driver) SetPWMFreq Uses

func (p *PCA9685Driver) SetPWMFreq(freq float32) error

SetPWMFreq sets the PWM frequency in Hz

func (*PCA9685Driver) Start Uses

func (p *PCA9685Driver) Start() (err error)

Start initializes the pca9685

type SHT3xDriver Uses

type SHT3xDriver struct {
    Units string

    Config
    // contains filtered or unexported fields
}

SHT3xDriver is a Driver for a SHT3x humidity and temperature sensor

func NewSHT3xDriver Uses

func NewSHT3xDriver(a Connector, options ...func(Config)) *SHT3xDriver

NewSHT3xDriver creates a new driver with specified i2c interface Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

func (*SHT3xDriver) Accuracy Uses

func (s *SHT3xDriver) Accuracy() byte

Accuracy returns the accuracy of the sampling

func (*SHT3xDriver) Connection Uses

func (s *SHT3xDriver) Connection() gobot.Connection

Connection returns the connection for this Driver

func (*SHT3xDriver) Halt Uses

func (s *SHT3xDriver) Halt() (err error)

Halt returns true if devices is halted successfully

func (*SHT3xDriver) Heater Uses

func (s *SHT3xDriver) Heater() (status bool, err error)

Heater returns true if the heater is enabled

func (*SHT3xDriver) Name Uses

func (s *SHT3xDriver) Name() string

Name returns the name for this Driver

func (*SHT3xDriver) Sample Uses

func (s *SHT3xDriver) Sample() (temp float32, rh float32, err error)

Sample returns the temperature in celsius and relative humidity for one sample

func (*SHT3xDriver) SerialNumber Uses

func (s *SHT3xDriver) SerialNumber() (sn uint32, err error)

SerialNumber returns the serial number of the chip

func (*SHT3xDriver) SetAccuracy Uses

func (s *SHT3xDriver) SetAccuracy(a byte) (err error)

SetAccuracy sets the accuracy of the sampling

func (*SHT3xDriver) SetAddress Uses

func (s *SHT3xDriver) SetAddress(address int)

SetAddress sets the address of the device

func (*SHT3xDriver) SetHeater Uses

func (s *SHT3xDriver) SetHeater(enabled bool) (err error)

SetHeater enables or disables the heater on the device

func (*SHT3xDriver) SetName Uses

func (s *SHT3xDriver) SetName(n string)

SetName sets the name for this Driver

func (*SHT3xDriver) Start Uses

func (s *SHT3xDriver) Start() (err error)

Start initializes the SHT3x

type SSD1306Driver Uses

type SSD1306Driver struct {
    Config
    gobot.Commander

    DisplayWidth  int
    DisplayHeight int
    Buffer        *DisplayBuffer
    // contains filtered or unexported fields
}

SSD1306Driver is a Gobot Driver for a SSD1306 Display

func NewSSD1306Driver Uses

func NewSSD1306Driver(a Connector, options ...func(Config)) *SSD1306Driver

NewSSD1306Driver creates a new SSD1306Driver.

Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

WithBus(int):    			bus to use with this driver
WithAddress(int):    		address to use with this driver
WithDisplayWidth(int): 	width of display (defaults to 128)
WithDisplayHeight(int): 	height of display (defaults to 64)

func (*SSD1306Driver) Clear Uses

func (s *SSD1306Driver) Clear() (err error)

Clear clears

func (*SSD1306Driver) Connection Uses

func (s *SSD1306Driver) Connection() gobot.Connection

Connection returns the connection for the Driver

func (*SSD1306Driver) Display Uses

func (s *SSD1306Driver) Display() (err error)

Display sends the memory buffer to the display

func (*SSD1306Driver) Halt Uses

func (s *SSD1306Driver) Halt() (err error)

Halt returns true if device is halted successfully

func (*SSD1306Driver) Init Uses

func (s *SSD1306Driver) Init() (err error)

Init turns display on

func (*SSD1306Driver) Name Uses

func (s *SSD1306Driver) Name() string

Name returns the Name for the Driver

func (*SSD1306Driver) Off Uses

func (s *SSD1306Driver) Off() (err error)

Off turns display off

func (*SSD1306Driver) On Uses

func (s *SSD1306Driver) On() (err error)

On turns display on

func (*SSD1306Driver) Reset Uses

func (s *SSD1306Driver) Reset() (err error)

Reset sends the memory buffer to the display

func (*SSD1306Driver) Set Uses

func (s *SSD1306Driver) Set(x, y, c int)

Set sets a pixel

func (*SSD1306Driver) SetContrast Uses

func (s *SSD1306Driver) SetContrast(contrast byte) (err error)

SetContrast sets the display contrast

func (*SSD1306Driver) SetName Uses

func (s *SSD1306Driver) SetName(n string)

SetName sets the Name for the Driver

func (*SSD1306Driver) Start Uses

func (s *SSD1306Driver) Start() (err error)

Start starts the Driver up, and writes start command

type TSL2561Driver Uses

type TSL2561Driver struct {
    Config
    // contains filtered or unexported fields
}

TSL2561Driver is the gobot driver for the Adafruit Digital Luminosity/Lux/Light Sensor

Datasheet: http://www.adafruit.com/datasheets/TSL2561.pdf

Ported from the Adafruit driver at https://github.com/adafruit/Adafruit_TSL2561 by K. Townsend

func NewTSL2561Driver Uses

func NewTSL2561Driver(conn Connector, options ...func(Config)) *TSL2561Driver

NewTSL2561Driver creates a new driver for the TSL2561 device.

Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):		bus to use with this driver
i2c.WithAddress(int):		address to use with this driver
i2c.WithTSL2561Gain1X:		sets the gain to 1X
i2c.WithTSL2561Gain16X:		sets the gain to 16X
i2c.WithTSL2561AutoGain:	turns on auto gain
i2c.WithTSL2561IntegrationTime13MS:	sets integration time to 13ms
i2c.WithTSL2561IntegrationTime101MS: 	sets integration time to 101ms
i2c.WithTSL2561IntegrationTime402MS: 	sets integration time to 402ms

func (*TSL2561Driver) CalculateLux Uses

func (d *TSL2561Driver) CalculateLux(broadband uint16, ir uint16) (lux uint32)

CalculateLux converts raw sensor values to the standard SI Lux equivalent. Returns 65536 if the sensor is saturated.

func (*TSL2561Driver) Connection Uses

func (d *TSL2561Driver) Connection() gobot.Connection

Connection returns the connection of the device.

func (*TSL2561Driver) GetLuminocity Uses

func (d *TSL2561Driver) GetLuminocity() (broadband uint16, ir uint16, err error)

GetLuminocity gets the broadband and IR only values from the TSL2561, adjusting gain if auto-gain is enabled

func (*TSL2561Driver) Halt Uses

func (d *TSL2561Driver) Halt() error

Halt stops the device

func (*TSL2561Driver) Name Uses

func (d *TSL2561Driver) Name() string

Name returns the name of the device.

func (*TSL2561Driver) SetGain Uses

func (d *TSL2561Driver) SetGain(gain TSL2561Gain) error

SetGain adjusts the TSL2561 gain (sensitivity to light)

func (*TSL2561Driver) SetIntegrationTime Uses

func (d *TSL2561Driver) SetIntegrationTime(time TSL2561IntegrationTime) error

SetIntegrationTime sets integrations time for the TSL2561

func (*TSL2561Driver) SetName Uses

func (d *TSL2561Driver) SetName(name string)

SetName sets the name of the device.

func (*TSL2561Driver) Start Uses

func (d *TSL2561Driver) Start() (err error)

Start initializes the device.

type TSL2561Gain Uses

type TSL2561Gain int

TSL2561Gain is the type of all valid gain settings

const (
    // TSL2561Gain1X gain == 1x
    TSL2561Gain1X TSL2561Gain = 0x00 // No gain
    // TSL2561Gain16X gain == 16x
    TSL2561Gain16X = 0x10 // 16x gain
)

type TSL2561IntegrationTime Uses

type TSL2561IntegrationTime int

TSL2561IntegrationTime is the type of all valid integration time settings

const (
    // TSL2561IntegrationTime13MS integration time 13ms
    TSL2561IntegrationTime13MS TSL2561IntegrationTime = iota // 13.7ms
    // TSL2561IntegrationTime101MS integration time 101ms
    TSL2561IntegrationTime101MS // 101ms
    // TSL2561IntegrationTime402MS integration time 402ms
    TSL2561IntegrationTime402MS // 402ms
)

type ThreeDData Uses

type ThreeDData struct {
    X   int16
    Y   int16
    Z   int16
}

type WiichuckDriver Uses

type WiichuckDriver struct {
    Config

    gobot.Eventer
    // contains filtered or unexported fields
}

func NewWiichuckDriver Uses

func NewWiichuckDriver(a Connector, options ...func(Config)) *WiichuckDriver

NewWiichuckDriver creates a WiichuckDriver with specified i2c interface.

Params:

conn Connector - the Adaptor to use with this Driver

Optional params:

i2c.WithBus(int):	bus to use with this driver
i2c.WithAddress(int):	address to use with this driver

func (*WiichuckDriver) Connection Uses

func (w *WiichuckDriver) Connection() gobot.Connection

Connection returns the connection for the device.

func (*WiichuckDriver) Halt Uses

func (w *WiichuckDriver) Halt() (err error)

Halt returns true if driver is halted successfully

func (*WiichuckDriver) Joystick Uses

func (w *WiichuckDriver) Joystick() map[string]float64

Joystick returns the current value for the joystick

func (*WiichuckDriver) Name Uses

func (w *WiichuckDriver) Name() string

Name returns the name of the device.

func (*WiichuckDriver) SetName Uses

func (w *WiichuckDriver) SetName(n string)

SetName sets the name of the device.

func (*WiichuckDriver) Start Uses

func (w *WiichuckDriver) Start() (err error)

Start initilizes i2c and reads from adaptor using specified interval to update with new value

Package i2c imports 14 packages (graph) and is imported by 15 packages. Updated 2018-07-10. Refresh now. Tools for package owners.