Skip to content

Commit

Permalink
First cut of the GoPiGo3 driver, lacking grove peripherals.
Browse files Browse the repository at this point in the history
  • Loading branch information
ulisesflynn committed Aug 25, 2017
1 parent ca421ef commit 94f5ded
Show file tree
Hide file tree
Showing 10 changed files with 800 additions and 7 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ deps:
go.bug.st/serial.v1 \
github.com/veandco/go-sdl2/sdl \
golang.org/x/net/websocket \
golang.org/x/exp/io/spi \
golang.org/x/sys/unix
25 changes: 25 additions & 0 deletions drivers/spi/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SPI

This package provides drivers for [spi](https://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus) devices. It must be used along with the [raspberry pi](https://gobot.io/documentation/platforms/raspi) adaptor that supports the needed interfaces for spi devices. This uses the experimental [spi package](https://github.com/golang/exp/tree/master/io/spi) which only works on linux systems.

## Getting Started

## Installing
```
go get -d -u gobot.io/x/gobot/...
```

## Hardware Support
Gobot has a extensible system for connecting to hardware devices. The following spi devices are currently supported:

- GoPiGo3 robotics board (built for Rapsberry Pi, but in theory it could be used in another platform)

More drivers are coming soon...

## Using A Different Bus or Address

You can set a different SPI address or SPI bus than the default when initializing your SPI drivers by using optional parameters. Here is an example:

```go
blinkm := spi.NewGoPiGo3DriverDriver(e, spi.WithBus(0), spi.WithAddress(0x10), spi.With)
```
9 changes: 9 additions & 0 deletions drivers/spi/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
Package spi provides Gobot drivers for spi devices.
Uses "golang.org/x/exp/io/spi" for spi
Installing:
go get -d -u gobot.io/x/gobot
For further information refer to spi README:
https://github.com/hybridgroup/gobot/blob/master/drivers/spi/README.md
*/
package spi // import "gobot.io/x/gobot/drivers/spi"
Loading

0 comments on commit 94f5ded

Please sign in to comment.