Meet The Code
Gobot makes controlling robots and devices incredibly simple and fun.
All you need to get started is to install Gobot:
$ go get -d -u gobot.io/x/gobot/...
The "Hello, World" Of Things
This program connects to an Arduino, and toggles an LED, every one second.
package main import ( "time" "gobot.io/x/gobot" "gobot.io/x/gobot/drivers/gpio" "gobot.io/x/gobot/platforms/firmata" ) func main() { firmataAdaptor := firmata.NewAdaptor("/dev/ttyACM0") led := gpio.NewLedDriver(firmataAdaptor, "13") work := func() { gobot.Every(1*time.Second, func() { led.Toggle() }) } robot := gobot.NewRobot("bot", []gobot.Connection{firmataAdaptor}, []gobot.Device{led}, work, ) robot.Start() }
We've got many more examples to help you get started on your next IoT project!
Platform Support
Gobot has a extensible system for connecting to hardware devices. The following robotics and physical computing platforms are currently supported:
35 Platforms
-
ARDrone
-
Arduino
-
Beaglebone Black
-
Bebop
-
Bluetooth LE
-
C.H.I.P.
-
C.H.I.P. Pro
-
Digispark
-
DJI Tello
-
Dragonboard
-
ESP8266
-
GoPiGo3
-
HS-200
-
Intel Curie
-
Intel Edison
-
Intel Joule
-
Joystick
-
Keyboard
-
Leap Motion
-
Mavlink
-
Microbit
-
Minidrone
-
MQTT
-
NATS
-
Neurosky
-
OpenCV
-
Pebble
-
PocketBeagle
-
Raspberry Pi
-
Particle
-
Ollie
-
BB-8
-
Sphero
-
SPRK+
-
Tinker Board
19 GPIO drivers
Support for devices that use General Purpose Input/Output (GPIO) communication have a shared set of drivers provided using the "gobot/drivers/gpio" package:
-
AIP1640
-
Button
-
Buzzer
-
Direct Pin
-
Grove Button
-
Grove Buzzer
-
Grove Led
-
Grove Vibration Sensor
-
Grove Relay
-
Grove Touch
-
LED
-
Makey Button
-
Motor
-
PIR Motion Sensor
-
Relay
-
RGB LED
-
Servo
-
Stepper
-
TM1638
5 Analog I/O (AIO) drivers
Support for devices that use Analog Input/Output (AIO) communication have a shared set of drivers provided using the "gobot/drivers/aio" package:
24 I2C drivers
Support for devices that use Inter-Integrated Circuit (I2C) communication have a shared set of drivers provided using the "gobot/drivers/i2c" package:
-
Adafruit Motor HAT
-
ADS1015
-
ADS1115
-
BlinkM
-
BME280
-
BMP180
-
BMP280
-
DRV2605L
-
Grove LCD w/RGB
-
Grove Accelerometer
-
HMC6352 Compass
-
INA3221
-
JHD1313M1
-
L3GD20H
-
LIDAR-Lite
-
MCP23017
-
MMA7660
-
MPL115A2
-
MPU6050
-
PCA9685
-
SHT3X
-
SSD1306
-
TSL2561
-
Wiimote Nunchuk
8 SPI drivers
Support for devices that use Serial Peripheral Interface (SPI) communication have a shared set of drivers provided using the "gobot/drivers/spi" package:
API
Gobot includes a RESTful API to query the status of any connection, device or robot running in your swarm. It additionally has the ability to issue commands directly to your devices and robots. Check out http://cppp.io for more information.
It also comes with the robeaux React.JS interface baked right into its API server for quick and easy configuration.
You can check out more information on the Gobot API in the docs here
CLI
Gobot is designed to be using in conjunction with Gort, a Command Line Toolkit (CLI) for RobotOps. Gort provides tools to scan for connected devices, upload firmware, and it works perfectly with Gobot. Also included with Gobot is a CLI for generating new robots and adaptors.
Gobot also has it own CLI which you can learn more about here.
Be Part Of The Robot Evolution
- Code on Github: https://github.com/hybridgroup/gobot
- Slack: https://gophers.slack.com/messages/C0N5HDB08
- Twitter: @gobotio