2014-06-10 10:01:53 +08:00
# I2C
2014-04-26 18:11:51 +08:00
2016-12-08 20:24:03 +08:00
This package provides drivers for [i2c ](https://en.wikipedia.org/wiki/I%C2%B2C )devices. It must be used along with an adaptor such as [firmata ](https://gobot.io/x/gobot/platforms/firmata ) that supports the needed interfaces for i2c devices.
2014-04-26 18:11:51 +08:00
## Getting Started
2014-06-10 10:01:53 +08:00
## Installing
```
2016-12-08 20:24:03 +08:00
go get -d -u gobot.io/x/gobot/... & & go install gobot.io/x/gobot/platforms/i2c
2014-04-26 18:11:51 +08:00
```
2014-06-10 10:01:53 +08:00
2014-04-26 18:11:51 +08:00
## Hardware Support
Gobot has a extensible system for connecting to hardware devices. The following i2c devices are currently supported:
2017-01-03 17:22:06 +08:00
- Adafruit Motor Hat
- BlinkM LED
- BMP180 Barometric Pressure/Temperature/Altitude Sensor
2016-09-25 20:08:18 +08:00
- Grove Digital Accelerometer
- Grove RGB LCD
- HMC6352 Compass
2017-01-03 17:22:06 +08:00
- JHD1313M1 LCD Display w/RGB Backlight
2016-09-25 20:08:18 +08:00
- LIDAR-Lite
2017-01-03 17:22:06 +08:00
- L3GD20H 3-Axis Gyroscope
2016-09-25 20:08:18 +08:00
- MCP23017 Port Expander
- MMA7660 3-Axis Accelerometer
- MPL115A2 Barometer
2014-12-14 10:50:09 +08:00
- MPU6050 Accelerometer/Gyroscope
2017-01-03 17:21:09 +08:00
- SHT3x-D Temperature/Humidity
2014-04-26 18:11:51 +08:00
- Wii Nunchuck Controller
More drivers are coming soon...
2017-02-10 19:01:44 +08:00
## Using A Different Bus or Address
You can set a different I2C address or I2C bus than the default when initializing your I2C drivers by using optional parameters. Here is an example:
```go
blinkm := i2c.NewBlinkMDriver(e, i2c.WithBus(0), i2c.WithAddress(0x09))
```