hybridgroup.gobot/gpio
Adrian Zankich 27a2c42c54 Update gpio package 2014-04-27 19:34:16 -07:00
..
docs WIP combine all seperate adaptor and driver repos into a single repo 2014-04-26 03:11:51 -07:00
LICENSE WIP combine all seperate adaptor and driver repos into a single repo 2014-04-26 03:11:51 -07:00
README.md WIP combine all seperate adaptor and driver repos into a single repo 2014-04-26 03:11:51 -07:00
analog_sensor_driver.go Update gpio package 2014-04-27 19:34:16 -07:00
analog_sensor_driver_test.go Update gpio package 2014-04-27 19:34:16 -07:00
button_driver.go Update gpio package 2014-04-27 19:34:16 -07:00
button_driver_test.go Update gpio package 2014-04-27 19:34:16 -07:00
commands.go Update gpio package 2014-04-27 19:34:16 -07:00
direct_pin_driver.go Update gpio package 2014-04-27 19:34:16 -07:00
direct_pin_driver_test.go Update gpio package 2014-04-27 19:34:16 -07:00
gobot-gpio_suite_test.go Update gpio package 2014-04-27 19:34:16 -07:00
led_driver.go Update gpio package 2014-04-27 19:34:16 -07:00
led_driver_test.go Update gpio package 2014-04-27 19:34:16 -07:00
makey_button_driver.go Update gpio package 2014-04-27 19:34:16 -07:00
motor_driver.go Update gpio package 2014-04-27 19:34:16 -07:00
motor_driver_test.go Update gpio package 2014-04-27 19:34:16 -07:00
servo_driver.go Update gpio package 2014-04-27 19:34:16 -07:00
servo_driver_test.go Update gpio package 2014-04-27 19:34:16 -07:00
test_helper.go Update gpio package 2014-04-27 19:34:16 -07:00
utils.go Update gpio package 2014-04-27 19:34:16 -07:00

README.md

Gobot Drivers for GPIO

Gobot (http://gobot.io/) is a framework and set of libraries for robotics, physical computing, and the Internet of Thing written in the Go programming language (http://golang.org/).

This library provides drivers for General Purpose Input/Output (GPIO) devices (https://en.wikipedia.org/wiki/General_Purpose_Input/Output). It is normally not used directly, but instead is registered by adaptor library such as gobot-firmata (https://github.com/hybridgroup/gobot-firmata) that supports the needed interfaces for GPIO devices.

Build Status Coverage Status

Getting Started

Install the library with: go get -u github.com/hybridgroup/gobot-gpio

Examples

package main

import (
        "fmt"
        "github.com/hybridgroup/gobot"
        "github.com/hybridgroup/gobot-firmata"
        "github.com/hybridgroup/gobot-gpio"
)

func main() {

        firmata := new(gobotFirmata.FirmataAdaptor)
        firmata.Name = "firmata"
        firmata.Port = "/dev/ttyACM0"

        led := gobotGPIO.NewLed(firmata)
        led.Name = "led"
        led.Pin = "13"

        work := func() {
                gobot.Every("1s", func() {
                        led.Toggle()
                })
        }

        robot := gobot.Robot{
                Connections: []interface{}{firmata},
                Devices:     []interface{led},
                Work:        work,
        }

        robot.Start()
}

Hardware Support

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

  • Analog Sensor
  • Button
  • LED
  • Motor
  • Servo

More drivers are coming soon...

Documentation

We're busy adding documentation to our web site at http://gobot.io/ please check there as we continue to work on Gobot

Thank you!

Contributing

  • All patches must be provided under the Apache 2.0 License
  • Please use the -s option in git to "sign off" that the commit is your work and you are providing it under the Apache 2.0 License
  • Submit a Github Pull Request to the appropriate branch and ideally discuss the changes with us in IRC #gobotio on Freenode.
  • We will look at the patch, test it out, and give you feedback.
  • Avoid doing minor whitespace changes, renamings, etc. along with merged content. These will be done by the maintainers from time to time but they can complicate merges and should be done seperately.
  • Take care to maintain the existing coding style.
  • Add unit tests for any new or changed functionality.
  • All pull requests should be "fast forward"
    • If there are commits after yours use “git rebase -i <new_head_branch>”
    • If you have local changes you may need to use “git stash”
    • For git help see progit which is an awesome (and free) book on git

License

Copyright (c) 2013-2014 The Hybrid Group. Licensed under the Apache 2.0 license.