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: