From b6f5b3d2f6a573219e183a2e320d8e7407c45870 Mon Sep 17 00:00:00 2001 From: Max Matveev Date: Fri, 5 Feb 2016 22:16:51 -0800 Subject: [PATCH 01/10] OneWire bus impl --- CONTRIBUTING.md | 2 +- README.md | 86 +++++------ controller/hd44780/hd44780.go | 2 +- controller/hd44780/hd44780_test.go | 2 +- controller/mcp4725/mcp4725.go | 2 +- controller/pca9685/pca9685.go | 4 +- convertors/mcp3008/mcp3008.go | 2 +- descriptor.go | 1 + detect.go | 2 +- doc.go | 18 +-- embd/detect.go | 2 +- embd/main.go | 2 +- host/all/all.go | 4 +- host/bbb/analogpin.go | 2 +- host/bbb/analogpin_test.go | 2 +- host/bbb/bbb.go | 4 +- host/bbb/pwmpin.go | 4 +- host/bbb/pwmpin_test.go | 2 +- host/generic/digitalpin.go | 2 +- host/generic/digitalpin_test.go | 2 +- host/generic/i2cbus.go | 2 +- host/generic/interrupt.go | 2 +- host/generic/led.go | 2 +- host/generic/spibus.go | 2 +- host/rpi/onewirebus.go | 192 ++++++++++++++++++++++++ host/rpi/rpi.go | 11 +- interface/keypad/matrix4x3/matrix4x3.go | 2 +- motion/servo/servo.go | 2 +- onewire.go | 78 ++++++++++ onewiredriver.go | 44 ++++++ samples/28bjy-48.go | 4 +- samples/analog.go | 4 +- samples/analogshort.go | 4 +- samples/bh1750fvi.go | 6 +- samples/bmp085.go | 6 +- samples/bmp180.go | 6 +- samples/characterdisplay.go | 8 +- samples/fullblinker.go | 4 +- samples/gpio.go | 4 +- samples/gpiodetect.go | 4 +- samples/gpiodirect.go | 4 +- samples/gpiointerrupt.go | 4 +- samples/gpioshort.go | 4 +- samples/hd44780.go | 6 +- samples/keypad/matrix4x3.go | 4 +- samples/l3gd20.go | 6 +- samples/led.go | 4 +- samples/ledshort.go | 4 +- samples/lsm303.go | 6 +- samples/mcp3008.go | 6 +- samples/mcp4725.go | 6 +- samples/onewire.go | 72 +++++++++ samples/pca9685.go | 6 +- samples/pwm.go | 6 +- samples/servo.go | 8 +- samples/servobbb.go | 6 +- samples/servoblaster.go | 6 +- samples/simpleblinker.go | 4 +- samples/spi.go | 4 +- samples/spimcp3008.go | 4 +- samples/tmp006.go | 6 +- samples/universalblinker.go | 4 +- samples/us020.go | 6 +- samples/watersensor.go | 6 +- sensor/bh1750fvi/bh1750fvi.go | 2 +- sensor/bmp085/bmp085.go | 2 +- sensor/bmp180/bmp180.go | 2 +- sensor/l3gd20/l3gd20.go | 2 +- sensor/lsm303/lsm303.go | 2 +- sensor/tmp006/tmp006.go | 2 +- sensor/us020/us020.go | 2 +- sensor/watersensor/watersensor.go | 2 +- 72 files changed, 568 insertions(+), 174 deletions(-) create mode 100644 host/rpi/onewirebus.go create mode 100644 onewire.go create mode 100644 onewiredriver.go create mode 100644 samples/onewire.go diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 975aca7..b26f838 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ This actually is really simple. A few simple guidelines and we can break for dinner: * EMBD is designed with a lot of affection, with utmost importance given to the dev experience (read: the API feel and style.) So always think from that angle when creating the pull request -* [Documentation](https://godoc.org/github.com/kidoman/embd) helps drive adoption. No exceptions +* [Documentation](https://godoc.org/github.com/zlowred/embd) helps drive adoption. No exceptions When it comes to the code: diff --git a/README.md b/README.md index f37b5b5..0d8ba31 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# embd [![Build Status](https://travis-ci.org/kidoman/embd.svg?branch=master)](https://travis-ci.org/kidoman/embd) [![GoDoc](http://godoc.org/github.com/kidoman/embd?status.png)](http://godoc.org/github.com/kidoman/embd) +# embd [![Build Status](https://travis-ci.org/kidoman/embd.svg?branch=master)](https://travis-ci.org/kidoman/embd) [![GoDoc](http://godoc.org/github.com/zlowred/embd?status.png)](http://godoc.org/github.com/zlowred/embd) **embd** is a hardware abstraction layer (HAL) for embedded systems. @@ -6,7 +6,7 @@ It allows you to start your hardware hack on easily available hobby boards (like Development supported and sponsored by [**SoStronk**](https://www.sostronk.com) and [**ThoughtWorks**](http://www.thoughtworks.com/) -Also, you might be interested in: [Why Golang?](https://github.com/kidoman/embd/wiki/Why-Go) +Also, you might be interested in: [Why Golang?](https://github.com/zlowred/embd/wiki/Why-Go) [Blog post introducing EMBD](http://kidoman.io/framework/embd.html) @@ -20,8 +20,8 @@ package main import ( "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/rpi" // This loads the RPi driver + "github.com/zlowred/embd" + _ "github.com/zlowred/embd/host/rpi" // This loads the RPi driver ) func main() { @@ -34,7 +34,7 @@ func main() { Then install the EMBD package (go1.2 and greater is required): - $ go get github.com/kidoman/embd + $ go get github.com/zlowred/embd Build the binary*: @@ -58,7 +58,7 @@ Then run the program with ```sudo```*: * We are instructing the ```go``` compiler to create a binary which will run on the RaspberryPi processor * Assuming your RaspberryPi has an IP address of ```192.168.2.2```. Substitute as necessary * ```sudo``` (root) permission is required as we are controlling the hardware by writing to special files -* This sample program is optimized for brevity and does not clean up after itself. Click here to see the [full version](https://github.com/kidoman/embd/blob/master/samples/fullblinker.go) +* This sample program is optimized for brevity and does not clean up after itself. Click here to see the [full version](https://github.com/zlowred/embd/blob/master/samples/fullblinker.go) ## Getting Help @@ -76,7 +76,7 @@ Join the [mailing list](https://groups.google.com/forum/#!forum/go-embd) ## The command line tool - go get github.com/kidoman/embd/embd + go get github.com/zlowred/embd/embd will install a command line utility ```embd``` which will allow you to quickly get started with prototyping. The binary should be available in your ```$GOPATH/bin```. However, to be able to run this on a ARM based device, you will need to build it with ```GOOS=linux``` and ```GOARCH=arm``` environment variables set. @@ -96,14 +96,14 @@ Package **embd** provides a hardware abstraction layer for doing embedded progra on supported platforms like the Raspberry Pi and BeagleBone Black. Most of the examples below will work without change (i.e. the same binary) on all supported platforms. How cool is that? -Although samples are all present in the [samples](https://github.com/kidoman/embd/tree/master/samples) folder, +Although samples are all present in the [samples](https://github.com/zlowred/embd/tree/master/samples) folder, we will show a few choice examples here. Use the **LED** driver to toggle LEDs on the BBB: ```go -import "github.com/kidoman/embd" -import _ "github.com/kidoman/embd/host/all" +import "github.com/zlowred/embd" +import _ "github.com/zlowred/embd/host/all" ... embd.InitLED() defer embd.CloseLED() @@ -116,8 +116,8 @@ led.Toggle() Even shorter when quickly trying things out: ```go -import "github.com/kidoman/embd" -import _ "github.com/kidoman/embd/host/all" +import "github.com/zlowred/embd" +import _ "github.com/zlowred/embd/host/all" ... embd.InitLED() defer embd.CloseLED() @@ -130,8 +130,8 @@ embd.ToggleLED(3) BBB + **PWM**: ```go -import "github.com/kidoman/embd" -import _ "github.com/kidoman/embd/host/all" +import "github.com/zlowred/embd" +import _ "github.com/zlowred/embd/host/all" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -145,8 +145,8 @@ pwm.SetDuty(1000) Control **GPIO** pins on the RaspberryPi / BeagleBone Black: ```go -import "github.com/kidoman/embd" -import _ "github.com/kidoman/embd/host/all" +import "github.com/zlowred/embd" +import _ "github.com/zlowred/embd/host/all" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -158,8 +158,8 @@ embd.DigitalWrite(10, embd.High) Could also do: ```go -import "github.com/kidoman/embd" -import _ "github.com/kidoman/embd/host/all" +import "github.com/zlowred/embd" +import _ "github.com/zlowred/embd/host/all" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -173,9 +173,9 @@ pin.Write(embd.High) Or read data from the **Bosch BMP085** barometric sensor: ```go -import "github.com/kidoman/embd" -import "github.com/kidoman/embd/sensor/bmp085" -import _ "github.com/kidoman/embd/host/all" +import "github.com/zlowred/embd" +import "github.com/zlowred/embd/sensor/bmp085" +import _ "github.com/zlowred/embd/host/all" ... bus := embd.NewI2CBus(1) ... @@ -188,9 +188,9 @@ altitude, err := baro.Altitude() Even find out the heading from the **LSM303** magnetometer: ```go -import "github.com/kidoman/embd" -import "github.com/kidoman/embd/sensor/lsm303" -import _ "github.com/kidoman/embd/host/all" +import "github.com/zlowred/embd" +import "github.com/zlowred/embd/sensor/lsm303" +import _ "github.com/zlowred/embd/host/all" ... bus := embd.NewI2CBus(1) ... @@ -204,28 +204,28 @@ platforms. ## Protocols Supported -* **Digital GPIO** [Documentation](http://godoc.org/github.com/kidoman/embd#DigitalPin) -* **Analog GPIO** [Documentation](http://godoc.org/github.com/kidoman/embd#AnalogPin) -* **PWM** [Documentation](http://godoc.org/github.com/kidoman/embd#PWMPin) -* **I2C** [Documentation](http://godoc.org/github.com/kidoman/embd#I2CBus) -* **LED** [Documentation](http://godoc.org/github.com/kidoman/embd#LED) -* **SPI** [Documentation](http://godoc.org/github.com/kidoman/embd#SPIBus) +* **Digital GPIO** [Documentation](http://godoc.org/github.com/zlowred/embd#DigitalPin) +* **Analog GPIO** [Documentation](http://godoc.org/github.com/zlowred/embd#AnalogPin) +* **PWM** [Documentation](http://godoc.org/github.com/zlowred/embd#PWMPin) +* **I2C** [Documentation](http://godoc.org/github.com/zlowred/embd#I2CBus) +* **LED** [Documentation](http://godoc.org/github.com/zlowred/embd#LED) +* **SPI** [Documentation](http://godoc.org/github.com/zlowred/embd#SPIBus) ## Sensors Supported -* **TMP006** Thermopile sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/tmp006), [Datasheet](http://www.adafruit.com/datasheets/tmp006.pdf), [Userguide](http://www.adafruit.com/datasheets/tmp006ug.pdf) +* **TMP006** Thermopile sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/tmp006), [Datasheet](http://www.adafruit.com/datasheets/tmp006.pdf), [Userguide](http://www.adafruit.com/datasheets/tmp006ug.pdf) -* **BMP085** Barometric pressure sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/bmp085), [Datasheet](https://www.sparkfun.com/datasheets/Components/General/BST-BMP085-DS000-05.pdf) +* **BMP085** Barometric pressure sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/bmp085), [Datasheet](https://www.sparkfun.com/datasheets/Components/General/BST-BMP085-DS000-05.pdf) -* **BMP180** Barometric pressure sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/bmp180), [Datasheet](http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf) +* **BMP180** Barometric pressure sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/bmp180), [Datasheet](http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf) -* **LSM303** Accelerometer and magnetometer [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/lsm303), [Datasheet](https://www.sparkfun.com/datasheets/Sensors/Magneto/LSM303%20Datasheet.pdf) +* **LSM303** Accelerometer and magnetometer [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/lsm303), [Datasheet](https://www.sparkfun.com/datasheets/Sensors/Magneto/LSM303%20Datasheet.pdf) -* **L3GD20** Gyroscope [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/l3gd20), [Datasheet](http://www.adafruit.com/datasheets/L3GD20.pdf) +* **L3GD20** Gyroscope [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/l3gd20), [Datasheet](http://www.adafruit.com/datasheets/L3GD20.pdf) -* **US020** Ultrasonic proximity sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/us020), [Product Page](http://www.digibay.in/sensor/object-detection-and-proximity?product_id=239) +* **US020** Ultrasonic proximity sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/us020), [Product Page](http://www.digibay.in/sensor/object-detection-and-proximity?product_id=239) -* **BH1750FVI** Luminosity sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/bh1750fvi), [Datasheet](http://www.elechouse.com/elechouse/images/product/Digital%20light%20Sensor/bh1750fvi-e.pdf) +* **BH1750FVI** Luminosity sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/bh1750fvi), [Datasheet](http://www.elechouse.com/elechouse/images/product/Digital%20light%20Sensor/bh1750fvi-e.pdf) ## Interfaces @@ -233,11 +233,11 @@ platforms. ## Controllers -* **PCA9685** 16-channel, 12-bit PWM Controller with I2C protocol [Documentation](http://godoc.org/github.com/kidoman/embd/controller/pca9685), [Datasheet](http://www.adafruit.com/datasheets/PCA9685.pdf), [Product Page](http://www.adafruit.com/products/815) +* **PCA9685** 16-channel, 12-bit PWM Controller with I2C protocol [Documentation](http://godoc.org/github.com/zlowred/embd/controller/pca9685), [Datasheet](http://www.adafruit.com/datasheets/PCA9685.pdf), [Product Page](http://www.adafruit.com/products/815) -* **MCP4725** 12-bit DAC [Documentation](http://godoc.org/github.com/kidoman/embd/controller/mcp4725), [Datasheet](http://www.adafruit.com/datasheets/mcp4725.pdf), [Product Page](http://www.adafruit.com/products/935) +* **MCP4725** 12-bit DAC [Documentation](http://godoc.org/github.com/zlowred/embd/controller/mcp4725), [Datasheet](http://www.adafruit.com/datasheets/mcp4725.pdf), [Product Page](http://www.adafruit.com/products/935) -* **ServoBlaster** RPi PWM/PCM based PWM controller [Documentation](http://godoc.org/github.com/kidoman/embd/controller/servoblaster), [Product Page](https://github.com/richardghirst/PiBits/tree/master/ServoBlaster) +* **ServoBlaster** RPi PWM/PCM based PWM controller [Documentation](http://godoc.org/github.com/zlowred/embd/controller/servoblaster), [Product Page](https://github.com/richardghirst/PiBits/tree/master/ServoBlaster) ## Convertors @@ -245,10 +245,10 @@ platforms. ## Contributing -We look forward to your pull requests, but contributions which abide by the [guidelines](https://github.com/kidoman/embd/blob/master/CONTRIBUTING.md) will get a free beer! +We look forward to your pull requests, but contributions which abide by the [guidelines](https://github.com/zlowred/embd/blob/master/CONTRIBUTING.md) will get a free beer! -File an [issue](https://github.com/kidoman/embd/issues), open a [pull request](https://github.com/kidoman/embd/pulls). We are waiting. +File an [issue](https://github.com/zlowred/embd/issues), open a [pull request](https://github.com/zlowred/embd/pulls). We are waiting. ## About -EMBD is affectionately designed/developed by Karan Misra ([kidoman](https://github.com/kidoman)), Kunal Powar ([kunalpowar](https://github.com/kunalpowar)) and [FRIENDS](https://github.com/kidoman/embd/blob/master/AUTHORS). We also have a list of [CONTRIBUTORS](https://github.com/kidoman/embd/blob/master/CONTRIBUTORS). +EMBD is affectionately designed/developed by Karan Misra ([kidoman](https://github.com/kidoman)), Kunal Powar ([kunalpowar](https://github.com/kunalpowar)) and [FRIENDS](https://github.com/zlowred/embd/blob/master/AUTHORS). We also have a list of [CONTRIBUTORS](https://github.com/zlowred/embd/blob/master/CONTRIBUTORS). diff --git a/controller/hd44780/hd44780.go b/controller/hd44780/hd44780.go index 88032d5..5e12430 100644 --- a/controller/hd44780/hd44780.go +++ b/controller/hd44780/hd44780.go @@ -16,7 +16,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) type entryMode byte diff --git a/controller/hd44780/hd44780_test.go b/controller/hd44780/hd44780_test.go index b05dddc..34ef629 100644 --- a/controller/hd44780/hd44780_test.go +++ b/controller/hd44780/hd44780_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/controller/mcp4725/mcp4725.go b/controller/mcp4725/mcp4725.go index 1dcaa91..8727a54 100644 --- a/controller/mcp4725/mcp4725.go +++ b/controller/mcp4725/mcp4725.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/controller/pca9685/pca9685.go b/controller/pca9685/pca9685.go index 9a9407d..20a2966 100644 --- a/controller/pca9685/pca9685.go +++ b/controller/pca9685/pca9685.go @@ -7,8 +7,8 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" - "github.com/kidoman/embd/util" + "github.com/zlowred/embd" + "github.com/zlowred/embd/util" ) const ( diff --git a/convertors/mcp3008/mcp3008.go b/convertors/mcp3008/mcp3008.go index e5ecb99..d363fe7 100644 --- a/convertors/mcp3008/mcp3008.go +++ b/convertors/mcp3008/mcp3008.go @@ -3,7 +3,7 @@ package mcp3008 import ( "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) // MCP3008 represents a mcp3008 8bit DAC. diff --git a/descriptor.go b/descriptor.go index b891008..ccc9f09 100644 --- a/descriptor.go +++ b/descriptor.go @@ -15,6 +15,7 @@ type Descriptor struct { I2CDriver func() I2CDriver LEDDriver func() LEDDriver SPIDriver func() SPIDriver + W1Driver func() W1Driver } // The Describer type is a Descriptor provider. diff --git a/detect.go b/detect.go index a92ff4e..3eb6f1d 100644 --- a/detect.go +++ b/detect.go @@ -122,6 +122,6 @@ func DetectHost() (host Host, rev int, err error) { case strings.Contains(hardware, "BCM2708") || strings.Contains(hardware, "BCM2709"): return HostRPi, rev, nil default: - return HostNull, 0, fmt.Errorf(`embd: your host "%v:%v" is not supported at this moment. request support at https://github.com/kidoman/embd/issues`, host, model) + return HostNull, 0, fmt.Errorf(`embd: your host "%v:%v" is not supported at this moment. request support at https://github.com/zlowred/embd/issues`, host, model) } } diff --git a/doc.go b/doc.go index 80118d4..0b05449 100644 --- a/doc.go +++ b/doc.go @@ -7,7 +7,7 @@ Use the LED driver to toggle LEDs on the BBB: - import "github.com/kidoman/embd" + import "github.com/zlowred/embd" ... embd.InitLED() defer embd.CloseLED() @@ -18,7 +18,7 @@ Even shorter while prototyping: - import "github.com/kidoman/embd" + import "github.com/zlowred/embd" ... embd.InitLED() defer embd.CloseLED() @@ -27,7 +27,7 @@ BBB + PWM: - import "github.com/kidoman/embd" + import "github.com/zlowred/embd" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -39,7 +39,7 @@ Control GPIO pins on the RaspberryPi / BeagleBone Black: - import "github.com/kidoman/embd" + import "github.com/zlowred/embd" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -49,7 +49,7 @@ Could also do: - import "github.com/kidoman/embd" + import "github.com/zlowred/embd" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -61,8 +61,8 @@ Or read data from the Bosch BMP085 barometric sensor: - import "github.com/kidoman/embd" - import "github.com/kidoman/embd/sensor/bmp085" + import "github.com/zlowred/embd" + import "github.com/zlowred/embd/sensor/bmp085" ... bus := embd.NewI2CBus(1) ... @@ -73,8 +73,8 @@ Even find out the heading from the LSM303 magnetometer: - import "github.com/kidoman/embd" - import "github.com/kidoman/embd/sensor/lsm303" + import "github.com/zlowred/embd" + import "github.com/zlowred/embd/sensor/lsm303" ... bus := embd.NewI2CBus(1) ... diff --git a/embd/detect.go b/embd/detect.go index 6659980..671543f 100644 --- a/embd/detect.go +++ b/embd/detect.go @@ -5,7 +5,7 @@ import ( "os" "github.com/codegangsta/cli" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) func detect(c *cli.Context) { diff --git a/embd/main.go b/embd/main.go index 7ea7424..67082e6 100644 --- a/embd/main.go +++ b/embd/main.go @@ -4,7 +4,7 @@ import ( "os" "github.com/codegangsta/cli" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) var version = "0.1.0" diff --git a/host/all/all.go b/host/all/all.go index 5bfd7a9..e29411c 100644 --- a/host/all/all.go +++ b/host/all/all.go @@ -2,6 +2,6 @@ package all import ( - _ "github.com/kidoman/embd/host/bbb" - _ "github.com/kidoman/embd/host/rpi" + _ "github.com/zlowred/embd/host/bbb" + _ "github.com/zlowred/embd/host/rpi" ) diff --git a/host/bbb/analogpin.go b/host/bbb/analogpin.go index e12b9dd..2326601 100644 --- a/host/bbb/analogpin.go +++ b/host/bbb/analogpin.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) type analogPin struct { diff --git a/host/bbb/analogpin_test.go b/host/bbb/analogpin_test.go index 49f22cb..702e41d 100644 --- a/host/bbb/analogpin_test.go +++ b/host/bbb/analogpin_test.go @@ -3,7 +3,7 @@ package bbb import ( "testing" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) func TestAnalogPinClose(t *testing.T) { diff --git a/host/bbb/bbb.go b/host/bbb/bbb.go index f909627..c9ccf27 100644 --- a/host/bbb/bbb.go +++ b/host/bbb/bbb.go @@ -16,8 +16,8 @@ import ( "strings" "github.com/golang/glog" - "github.com/kidoman/embd" - "github.com/kidoman/embd/host/generic" + "github.com/zlowred/embd" + "github.com/zlowred/embd/host/generic" ) var pins = embd.PinMap{ diff --git a/host/bbb/pwmpin.go b/host/bbb/pwmpin.go index 1bd6c95..73cc81b 100644 --- a/host/bbb/pwmpin.go +++ b/host/bbb/pwmpin.go @@ -11,8 +11,8 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" - "github.com/kidoman/embd/util" + "github.com/zlowred/embd" + "github.com/zlowred/embd/util" ) const ( diff --git a/host/bbb/pwmpin_test.go b/host/bbb/pwmpin_test.go index 1c07ff3..fd27b9c 100644 --- a/host/bbb/pwmpin_test.go +++ b/host/bbb/pwmpin_test.go @@ -3,7 +3,7 @@ package bbb import ( "testing" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) func TestPWMPinClose(t *testing.T) { diff --git a/host/generic/digitalpin.go b/host/generic/digitalpin.go index 80a81ea..2dbb252 100644 --- a/host/generic/digitalpin.go +++ b/host/generic/digitalpin.go @@ -12,7 +12,7 @@ import ( "strconv" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) type digitalPin struct { diff --git a/host/generic/digitalpin_test.go b/host/generic/digitalpin_test.go index 18e900e..df5c99e 100644 --- a/host/generic/digitalpin_test.go +++ b/host/generic/digitalpin_test.go @@ -3,7 +3,7 @@ package generic import ( "testing" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) func TestDigitalPinClose(t *testing.T) { diff --git a/host/generic/i2cbus.go b/host/generic/i2cbus.go index dc8e74c..1cb10d4 100644 --- a/host/generic/i2cbus.go +++ b/host/generic/i2cbus.go @@ -12,7 +12,7 @@ import ( "unsafe" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/host/generic/interrupt.go b/host/generic/interrupt.go index 4052283..3eba081 100644 --- a/host/generic/interrupt.go +++ b/host/generic/interrupt.go @@ -8,7 +8,7 @@ import ( "sync" "syscall" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/host/generic/led.go b/host/generic/led.go index 67f56c9..21826bc 100644 --- a/host/generic/led.go +++ b/host/generic/led.go @@ -8,7 +8,7 @@ import ( "os" "strings" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) type led struct { diff --git a/host/generic/spibus.go b/host/generic/spibus.go index ad3bcec..99755ab 100644 --- a/host/generic/spibus.go +++ b/host/generic/spibus.go @@ -8,7 +8,7 @@ import ( "unsafe" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/host/rpi/onewirebus.go b/host/rpi/onewirebus.go new file mode 100644 index 0000000..48e4d0d --- /dev/null +++ b/host/rpi/onewirebus.go @@ -0,0 +1,192 @@ +// I²C support. + +package rpi + +import ( + "fmt" + "os" + "sync" + + "github.com/golang/glog" + "github.com/zlowred/embd" + "io/ioutil" +) + +type w1Bus struct { + l byte + busMap map[string]embd.W1Device + mu sync.Mutex + + initialized bool +} + +type w1Device struct { + file *os.File + addr string + mu sync.Mutex + + initialized bool +} + +func NewW1Bus(l byte) embd.W1Bus { + fmt.Println("new w1 bus") + return &w1Bus{l: l, busMap: make(map[string]embd.W1Device)} +} + +func (b *w1Bus) init() error { + if b.initialized { + return nil + } + + var err error + if _, err = os.Stat("/sys/bus/w1"); os.IsNotExist(err) { + return err + } + + glog.V(2).Infof("onewire: bus %v initialized", b.l) + + b.initialized = true + + return nil +} + +func (d *w1Device) init() error { + if d.initialized { + return nil + } + + var err error + if d.file, err = os.OpenFile(fmt.Sprintf("/sys/bus/w1/devices/%s/rw", d.addr), os.O_RDWR, os.ModeExclusive); err != nil { + return err + } + + glog.V(2).Infof("onewire: device %s initialized", d.addr) + + d.initialized = true + + return nil +} + +func (d *w1Device) ReadByte() (byte, error) { + d.mu.Lock() + defer d.mu.Unlock() + + if err := d.init(); err != nil { + return 0, err + } + + bytes := make([]byte, 1) + n, _ := d.file.Read(bytes) + + if n != 1 { + return 0, fmt.Errorf("onewire: Unexpected number (%v) of bytes read in ReadByte", n) + } + + return bytes[0], nil +} + +func (d *w1Device) WriteByte(value byte) error { + d.mu.Lock() + defer d.mu.Unlock() + + if err := d.init(); err != nil { + return err + } + + n, err := d.file.Write([]byte{value}) + + if n != 1 { + err = fmt.Errorf("onewire: Unexpected number (%v) of bytes written in WriteByte", n) + } + + return err +} + +func (d *w1Device) WriteBytes(value []byte) error { + d.mu.Lock() + defer d.mu.Unlock() + + if err := d.init(); err != nil { + return err + } + + for i := range value { + n, err := d.file.Write([]byte{value[i]}) + + if n != 1 { + return fmt.Errorf("onewire: Unexpected number (%v) of bytes written in WriteBytes", n) + } + if err != nil { + return err + } + } + + return nil +} + +func (d *w1Device) ReadBytes(number int) (value []byte, err error) { + d.mu.Lock() + defer d.mu.Unlock() + + if err := d.init(); err != nil { + return nil, err + } + + bytes := make([]byte, number) + n, _ := d.file.Read(bytes) + + if n != number { + return nil, fmt.Errorf("onewire: Unexpected number (%v) of bytes read in ReadBytes", n) + } + + return bytes, nil +} + +func (b *w1Bus) ListDevices() (devices []string, err error) { + dir, err := ioutil.ReadDir("/sys/bus/w1/devices/") + if err != nil { + return nil, err + } + devs := make([]string, len(dir)) + + for index, element := range dir { + devs[index] = element.Name() + } + + return devs, nil +} + +func (b *w1Bus) Open(address string) (device embd.W1Device, err error) { + b.mu.Lock() + defer b.mu.Unlock() + + if d, ok := b.busMap[address]; ok { + return d, nil + } + + d := &w1Device{addr: address} + b.busMap[address] = d + return d, nil +} + +func (b *w1Bus) Close() error { + b.mu.Lock() + defer b.mu.Unlock() + + for _, b := range b.busMap { + b.Close() + } + + return nil +} + +func (b *w1Device) Close() error { + b.mu.Lock() + defer b.mu.Unlock() + + if !b.initialized { + return nil + } + + return b.file.Close() +} diff --git a/host/rpi/rpi.go b/host/rpi/rpi.go index 0a82a4b..84acb1b 100644 --- a/host/rpi/rpi.go +++ b/host/rpi/rpi.go @@ -5,12 +5,14 @@ GPIO (digital (rw)) I²C LED + W1 - make sure that w1-gpio kernel module is loaded. If you wish to use it with sensors directly (e.g. DS18B20 etc) make sure to disable respective kernel modules (e.g. w1-therm) in /etc/modprobe.d/blacklist.conf. */ package rpi import ( - "github.com/kidoman/embd" - "github.com/kidoman/embd/host/generic" + "github.com/zlowred/embd" + "github.com/zlowred/embd/host/generic" + "fmt" ) var spiDeviceMinor = byte(0) @@ -73,6 +75,7 @@ var ledMap = embd.LEDMap{ } func init() { + fmt.Println("registering RPI") embd.Register(embd.HostRPi, func(rev int) *embd.Descriptor { // Refer to http://elinux.org/RPi_HardwareHistory#Board_Revision_History // for details. @@ -97,6 +100,10 @@ func init() { SPIDriver: func() embd.SPIDriver { return embd.NewSPIDriver(spiDeviceMinor, generic.NewSPIBus, nil) }, + W1Driver: func() embd.W1Driver { + return embd.NewW1Driver(NewW1Bus) + }, } }) + fmt.Println("registered") } diff --git a/interface/keypad/matrix4x3/matrix4x3.go b/interface/keypad/matrix4x3/matrix4x3.go index 6ef984f..cb268b4 100644 --- a/interface/keypad/matrix4x3/matrix4x3.go +++ b/interface/keypad/matrix4x3/matrix4x3.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) type Key int diff --git a/motion/servo/servo.go b/motion/servo/servo.go index c0876d2..5bb51f9 100644 --- a/motion/servo/servo.go +++ b/motion/servo/servo.go @@ -3,7 +3,7 @@ package servo import ( "github.com/golang/glog" - "github.com/kidoman/embd/util" + "github.com/zlowred/embd/util" ) const ( diff --git a/onewire.go b/onewire.go new file mode 100644 index 0000000..9907a78 --- /dev/null +++ b/onewire.go @@ -0,0 +1,78 @@ +//OneWire support. + +package embd + +// W1Bus interface is used to interact with the OneWire bus. +type W1Bus interface { + + // List devices on the bus + ListDevices() (devices []string, err error) + + // Open a device + Open(address string) (device W1Device, err error) + + // Close releases the resources associated with the bus. + Close() error +} + +// W1Device interface is user to interact with the OneWire device. +type W1Device interface { + // ReadByte reads a byte from the device. + ReadByte() (value byte, err error) + // ReadByte number of bytes from the device. + ReadBytes(number int) (value []byte, err error) + // WriteByte writes a byte to the device. + WriteByte(value byte) error + // WriteBytes writes a slice bytes to the device. + WriteBytes(value []byte) error + + // Close releases the resources associated with the device. + Close() error +} + +// W1Driver interface interacts with the host descriptors to allow us +// control of OneWire communication. +type W1Driver interface { + Bus(l byte) W1Bus + + // Close releases the resources associated with the driver. + Close() error +} + +var w1DriverInitialized bool +var w1DriverInstance W1Driver + +// InitW1 initializes the W1 driver. +func InitW1() error { + if w1DriverInitialized { + return nil + } + + desc, err := DescribeHost() + if err != nil { + return err + } + + if desc.W1Driver == nil { + return ErrFeatureNotSupported + } + + w1DriverInstance = desc.W1Driver() + w1DriverInitialized = true + + return nil +} + +// CloseW1 releases resources associated with the OneWire driver. +func CloseW1() error { + return w1DriverInstance.Close() +} + +// NewW1Bus returns a W1Bus. +func NewW1Bus(l byte) W1Bus { + if err := InitW1(); err != nil { + panic(err) + } + + return w1DriverInstance.Bus(l) +} diff --git a/onewiredriver.go b/onewiredriver.go new file mode 100644 index 0000000..38ed5e8 --- /dev/null +++ b/onewiredriver.go @@ -0,0 +1,44 @@ +// Generic OneWire driver. + +package embd + +import "sync" + +type w1BusFactory func(byte) W1Bus + +type w1Driver struct { + busMap map[byte]W1Bus + busMapLock sync.Mutex + + ibf w1BusFactory +} + +// NewW1Driver returns a W1Driver interface which allows control +// over the OneWire subsystem. +func NewW1Driver(ibf w1BusFactory) W1Driver { + return &w1Driver{ + busMap: make(map[byte]W1Bus), + ibf: ibf, + } +} + +func (i *w1Driver) Bus(l byte) W1Bus { + i.busMapLock.Lock() + defer i.busMapLock.Unlock() + + if b, ok := i.busMap[l]; ok { + return b + } + + b := i.ibf(l) + i.busMap[l] = b + return b +} + +func (i *w1Driver) Close() error { + for _, b := range i.busMap { + b.Close() + } + + return nil +} diff --git a/samples/28bjy-48.go b/samples/28bjy-48.go index 456b7db..f49be5f 100644 --- a/samples/28bjy-48.go +++ b/samples/28bjy-48.go @@ -18,8 +18,8 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/rpi" + "github.com/zlowred/embd" + _ "github.com/zlowred/embd/host/rpi" ) func main() { diff --git a/samples/analog.go b/samples/analog.go index 687ecd5..b935e2a 100644 --- a/samples/analog.go +++ b/samples/analog.go @@ -9,9 +9,9 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/analogshort.go b/samples/analogshort.go index 064be32..501224a 100644 --- a/samples/analogshort.go +++ b/samples/analogshort.go @@ -6,9 +6,9 @@ import ( "flag" "fmt" - "github.com/kidoman/embd" + "github.com/zlowred/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/bh1750fvi.go b/samples/bh1750fvi.go index 83e9a72..1b7139a 100644 --- a/samples/bh1750fvi.go +++ b/samples/bh1750fvi.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/bh1750fvi" + "github.com/zlowred/embd" + "github.com/zlowred/embd/sensor/bh1750fvi" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/bmp085.go b/samples/bmp085.go index 0fa56ad..7860a39 100644 --- a/samples/bmp085.go +++ b/samples/bmp085.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/bmp085" + "github.com/zlowred/embd" + "github.com/zlowred/embd/sensor/bmp085" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/bmp180.go b/samples/bmp180.go index 845e771..f39ae2b 100644 --- a/samples/bmp180.go +++ b/samples/bmp180.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/bmp180" + "github.com/zlowred/embd" + "github.com/zlowred/embd/sensor/bmp180" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/characterdisplay.go b/samples/characterdisplay.go index 7a054aa..5b14410 100644 --- a/samples/characterdisplay.go +++ b/samples/characterdisplay.go @@ -6,11 +6,11 @@ import ( "flag" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/controller/hd44780" - "github.com/kidoman/embd/interface/display/characterdisplay" + "github.com/zlowred/embd" + "github.com/zlowred/embd/controller/hd44780" + "github.com/zlowred/embd/interface/display/characterdisplay" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/fullblinker.go b/samples/fullblinker.go index 7e43b36..2e07e39 100644 --- a/samples/fullblinker.go +++ b/samples/fullblinker.go @@ -11,8 +11,8 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/rpi" + "github.com/zlowred/embd" + _ "github.com/zlowred/embd/host/rpi" ) func main() { diff --git a/samples/gpio.go b/samples/gpio.go index b3769eb..ab5c1fa 100644 --- a/samples/gpio.go +++ b/samples/gpio.go @@ -6,9 +6,9 @@ import ( "flag" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/gpiodetect.go b/samples/gpiodetect.go index 8bc5f78..f709667 100644 --- a/samples/gpiodetect.go +++ b/samples/gpiodetect.go @@ -6,9 +6,9 @@ import ( "flag" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/gpiodirect.go b/samples/gpiodirect.go index 85bd22c..d4d3002 100644 --- a/samples/gpiodirect.go +++ b/samples/gpiodirect.go @@ -6,9 +6,9 @@ import ( "flag" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/gpiointerrupt.go b/samples/gpiointerrupt.go index 9b6ccc9..ebf4386 100644 --- a/samples/gpiointerrupt.go +++ b/samples/gpiointerrupt.go @@ -6,9 +6,9 @@ import ( "flag" "fmt" - "github.com/kidoman/embd" + "github.com/zlowred/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/gpioshort.go b/samples/gpioshort.go index b1c5c2c..a05c449 100644 --- a/samples/gpioshort.go +++ b/samples/gpioshort.go @@ -5,9 +5,9 @@ package main import ( "flag" - "github.com/kidoman/embd" + "github.com/zlowred/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/hd44780.go b/samples/hd44780.go index 418fa7e..aecd01d 100644 --- a/samples/hd44780.go +++ b/samples/hd44780.go @@ -6,10 +6,10 @@ import ( "flag" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/controller/hd44780" + "github.com/zlowred/embd" + "github.com/zlowred/embd/controller/hd44780" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/keypad/matrix4x3.go b/samples/keypad/matrix4x3.go index 9b4feda..9d54dea 100644 --- a/samples/keypad/matrix4x3.go +++ b/samples/keypad/matrix4x3.go @@ -5,8 +5,8 @@ package main import ( "fmt" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/interface/keypad/matrix4x3" + "github.com/zlowred/embd" + "github.com/zlowred/embd/interface/keypad/matrix4x3" ) func main() { diff --git a/samples/l3gd20.go b/samples/l3gd20.go index f0a94e6..2710d39 100644 --- a/samples/l3gd20.go +++ b/samples/l3gd20.go @@ -9,10 +9,10 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/l3gd20" + "github.com/zlowred/embd" + "github.com/zlowred/embd/sensor/l3gd20" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/led.go b/samples/led.go index 82650d0..6cacd1e 100644 --- a/samples/led.go +++ b/samples/led.go @@ -11,9 +11,9 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" - _ "github.com/kidoman/embd/host/bbb" + _ "github.com/zlowred/embd/host/bbb" ) func main() { diff --git a/samples/ledshort.go b/samples/ledshort.go index 64a01ce..8cd2c2c 100644 --- a/samples/ledshort.go +++ b/samples/ledshort.go @@ -8,9 +8,9 @@ import ( "flag" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" - _ "github.com/kidoman/embd/host/bbb" + _ "github.com/zlowred/embd/host/bbb" ) func main() { diff --git a/samples/lsm303.go b/samples/lsm303.go index e4461de..d08b11b 100644 --- a/samples/lsm303.go +++ b/samples/lsm303.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/lsm303" + "github.com/zlowred/embd" + "github.com/zlowred/embd/sensor/lsm303" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/mcp3008.go b/samples/mcp3008.go index 791d56a..eedf3be 100644 --- a/samples/mcp3008.go +++ b/samples/mcp3008.go @@ -8,9 +8,9 @@ import ( "fmt" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/convertors/mcp3008" - _ "github.com/kidoman/embd/host/all" + "github.com/zlowred/embd" + "github.com/zlowred/embd/convertors/mcp3008" + _ "github.com/zlowred/embd/host/all" ) const ( diff --git a/samples/mcp4725.go b/samples/mcp4725.go index ad80967..7dbc8f7 100644 --- a/samples/mcp4725.go +++ b/samples/mcp4725.go @@ -9,10 +9,10 @@ import ( "os" "os/signal" - "github.com/kidoman/embd" - "github.com/kidoman/embd/controller/mcp4725" + "github.com/zlowred/embd" + "github.com/zlowred/embd/controller/mcp4725" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/onewire.go b/samples/onewire.go new file mode 100644 index 0000000..e213bb3 --- /dev/null +++ b/samples/onewire.go @@ -0,0 +1,72 @@ +// +build ignore + +package main + +import ( + "fmt" + + "github.com/zlowred/embd" + _ "github.com/zlowred/embd/host/all" +) + +func main() { + if err := embd.InitW1(); err != nil { + panic(err) + } + defer embd.CloseW1() + + w1 := embd.NewW1Bus(0) + + devs, err := w1.ListDevices() + + if err != nil { + panic(err) + } + + for _, dev := range devs { + fmt.Println("OneWire device: %s", dev) + } + + w1d, err := w1.Open("28-011572120bff") + + if err != nil { + panic(err) + } + + fmt.Printf("%v\n", w1d) + + err = w1d.WriteByte(0x44) + + if err != nil { + panic(err) + } + + for ret, err := w1d.ReadByte(); ret == 0 && err != nil; {} + + if err != nil { + panic(err) + } + + err = w1d.WriteByte(0xBE) + + if err != nil { + panic(err) + } + + res, err := w1d.ReadBytes(9) + + if err != nil { + panic(err) + } + + fmt.Print("res: ") + for _, val := range res { + fmt.Printf("0x%02X ", val) + } + fmt.Println() + + var temp float64 = float64(float64(res[1]) * 256. + float64(res[0])) / 16. + fmt.Printf("%f\n", temp) + + fmt.Println("Done") +} diff --git a/samples/pca9685.go b/samples/pca9685.go index 9976340..aca5db3 100644 --- a/samples/pca9685.go +++ b/samples/pca9685.go @@ -8,10 +8,10 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/controller/pca9685" + "github.com/zlowred/embd" + "github.com/zlowred/embd/controller/pca9685" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/pwm.go b/samples/pwm.go index cecbc4d..86f62f3 100644 --- a/samples/pwm.go +++ b/samples/pwm.go @@ -8,10 +8,10 @@ import ( "flag" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/host/bbb" + "github.com/zlowred/embd" + "github.com/zlowred/embd/host/bbb" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/servo.go b/samples/servo.go index 2e82dd8..a451d97 100644 --- a/samples/servo.go +++ b/samples/servo.go @@ -8,11 +8,11 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/controller/pca9685" - "github.com/kidoman/embd/motion/servo" + "github.com/zlowred/embd" + "github.com/zlowred/embd/controller/pca9685" + "github.com/zlowred/embd/motion/servo" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/servobbb.go b/samples/servobbb.go index fbf0db1..ba4ecdd 100644 --- a/samples/servobbb.go +++ b/samples/servobbb.go @@ -8,10 +8,10 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/motion/servo" + "github.com/zlowred/embd" + "github.com/zlowred/embd/motion/servo" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/servoblaster.go b/samples/servoblaster.go index b2d4cdf..777c673 100644 --- a/samples/servoblaster.go +++ b/samples/servoblaster.go @@ -8,10 +8,10 @@ import ( "os/signal" "time" - "github.com/kidoman/embd/controller/servoblaster" - "github.com/kidoman/embd/motion/servo" + "github.com/zlowred/embd/controller/servoblaster" + "github.com/zlowred/embd/motion/servo" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/simpleblinker.go b/samples/simpleblinker.go index 9e4f780..8ef0e5a 100644 --- a/samples/simpleblinker.go +++ b/samples/simpleblinker.go @@ -8,8 +8,8 @@ package main import ( "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/rpi" // This loads the RPi driver + "github.com/zlowred/embd" + _ "github.com/zlowred/embd/host/rpi" // This loads the RPi driver ) func main() { diff --git a/samples/spi.go b/samples/spi.go index 298acc4..8a76c0d 100644 --- a/samples/spi.go +++ b/samples/spi.go @@ -5,8 +5,8 @@ package main import ( "fmt" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/all" + "github.com/zlowred/embd" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/spimcp3008.go b/samples/spimcp3008.go index 394243e..fee3274 100644 --- a/samples/spimcp3008.go +++ b/samples/spimcp3008.go @@ -7,8 +7,8 @@ import ( "fmt" "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/all" + "github.com/zlowred/embd" + _ "github.com/zlowred/embd/host/all" ) const ( diff --git a/samples/tmp006.go b/samples/tmp006.go index 6252b00..2ce5190 100644 --- a/samples/tmp006.go +++ b/samples/tmp006.go @@ -8,10 +8,10 @@ import ( "os" "os/signal" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/tmp006" + "github.com/zlowred/embd" + "github.com/zlowred/embd/sensor/tmp006" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/universalblinker.go b/samples/universalblinker.go index 190ae1d..03f2ccd 100644 --- a/samples/universalblinker.go +++ b/samples/universalblinker.go @@ -10,8 +10,8 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/all" + "github.com/zlowred/embd" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/us020.go b/samples/us020.go index f0e7537..7406b7c 100644 --- a/samples/us020.go +++ b/samples/us020.go @@ -9,10 +9,10 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/us020" + "github.com/zlowred/embd" + "github.com/zlowred/embd/sensor/us020" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/watersensor.go b/samples/watersensor.go index ff4ba8a..4890a60 100644 --- a/samples/watersensor.go +++ b/samples/watersensor.go @@ -7,10 +7,10 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/watersensor" + "github.com/zlowred/embd" + "github.com/zlowred/embd/sensor/watersensor" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/sensor/bh1750fvi/bh1750fvi.go b/sensor/bh1750fvi/bh1750fvi.go index 6903bb8..f774211 100644 --- a/sensor/bh1750fvi/bh1750fvi.go +++ b/sensor/bh1750fvi/bh1750fvi.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) //accuracy = sensorValue/actualValue] (min = 0.96, typ = 1.2, max = 1.44 diff --git a/sensor/bmp085/bmp085.go b/sensor/bmp085/bmp085.go index b58b37b..c8c184d 100644 --- a/sensor/bmp085/bmp085.go +++ b/sensor/bmp085/bmp085.go @@ -8,7 +8,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/sensor/bmp180/bmp180.go b/sensor/bmp180/bmp180.go index fdc46f3..bcab5b3 100644 --- a/sensor/bmp180/bmp180.go +++ b/sensor/bmp180/bmp180.go @@ -8,7 +8,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/sensor/l3gd20/l3gd20.go b/sensor/l3gd20/l3gd20.go index c3ad94a..c59e2c8 100644 --- a/sensor/l3gd20/l3gd20.go +++ b/sensor/l3gd20/l3gd20.go @@ -8,7 +8,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/sensor/lsm303/lsm303.go b/sensor/lsm303/lsm303.go index 583a0a8..d390045 100644 --- a/sensor/lsm303/lsm303.go +++ b/sensor/lsm303/lsm303.go @@ -7,7 +7,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/sensor/tmp006/tmp006.go b/sensor/tmp006/tmp006.go index 842204b..f6347e9 100644 --- a/sensor/tmp006/tmp006.go +++ b/sensor/tmp006/tmp006.go @@ -9,7 +9,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/sensor/us020/us020.go b/sensor/us020/us020.go index b7d400a..83e581b 100644 --- a/sensor/us020/us020.go +++ b/sensor/us020/us020.go @@ -6,7 +6,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/sensor/watersensor/watersensor.go b/sensor/watersensor/watersensor.go index c83628e..7b1dfe5 100644 --- a/sensor/watersensor/watersensor.go +++ b/sensor/watersensor/watersensor.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) // WaterSensor represents a water sensor. From 212ddeafe6a269b733e65f8c17af0181505ef27c Mon Sep 17 00:00:00 2001 From: Max Matveev Date: Fri, 5 Feb 2016 22:23:18 -0800 Subject: [PATCH 02/10] OneWire bus impl - changed imports to the original ones so that merge is possible --- CONTRIBUTING.md | 2 +- README.md | 86 ++++++++++++------------- controller/hd44780/hd44780.go | 2 +- controller/hd44780/hd44780_test.go | 2 +- controller/mcp4725/mcp4725.go | 2 +- controller/pca9685/pca9685.go | 4 +- convertors/mcp3008/mcp3008.go | 2 +- detect.go | 2 +- doc.go | 18 +++--- embd/detect.go | 2 +- embd/main.go | 2 +- host/all/all.go | 4 +- host/bbb/analogpin.go | 2 +- host/bbb/analogpin_test.go | 2 +- host/bbb/bbb.go | 4 +- host/bbb/pwmpin.go | 4 +- host/bbb/pwmpin_test.go | 2 +- host/generic/digitalpin.go | 2 +- host/generic/digitalpin_test.go | 2 +- host/generic/i2cbus.go | 2 +- host/generic/interrupt.go | 2 +- host/generic/led.go | 2 +- host/generic/spibus.go | 2 +- host/rpi/onewirebus.go | 2 +- host/rpi/rpi.go | 7 +- interface/keypad/matrix4x3/matrix4x3.go | 2 +- motion/servo/servo.go | 2 +- samples/28bjy-48.go | 4 +- samples/analog.go | 4 +- samples/analogshort.go | 4 +- samples/bh1750fvi.go | 6 +- samples/bmp085.go | 6 +- samples/bmp180.go | 6 +- samples/characterdisplay.go | 8 +-- samples/fullblinker.go | 4 +- samples/gpio.go | 4 +- samples/gpiodetect.go | 4 +- samples/gpiodirect.go | 4 +- samples/gpiointerrupt.go | 4 +- samples/gpioshort.go | 4 +- samples/hd44780.go | 6 +- samples/keypad/matrix4x3.go | 4 +- samples/l3gd20.go | 6 +- samples/led.go | 4 +- samples/ledshort.go | 4 +- samples/lsm303.go | 6 +- samples/mcp3008.go | 6 +- samples/mcp4725.go | 6 +- samples/onewire.go | 4 +- samples/pca9685.go | 6 +- samples/pwm.go | 6 +- samples/servo.go | 8 +-- samples/servobbb.go | 6 +- samples/servoblaster.go | 6 +- samples/simpleblinker.go | 4 +- samples/spi.go | 4 +- samples/spimcp3008.go | 4 +- samples/tmp006.go | 6 +- samples/universalblinker.go | 4 +- samples/us020.go | 6 +- samples/watersensor.go | 6 +- sensor/bh1750fvi/bh1750fvi.go | 2 +- sensor/bmp085/bmp085.go | 2 +- sensor/bmp180/bmp180.go | 2 +- sensor/l3gd20/l3gd20.go | 2 +- sensor/lsm303/lsm303.go | 2 +- sensor/tmp006/tmp006.go | 2 +- sensor/us020/us020.go | 2 +- sensor/watersensor/watersensor.go | 2 +- 69 files changed, 179 insertions(+), 178 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b26f838..975aca7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ This actually is really simple. A few simple guidelines and we can break for dinner: * EMBD is designed with a lot of affection, with utmost importance given to the dev experience (read: the API feel and style.) So always think from that angle when creating the pull request -* [Documentation](https://godoc.org/github.com/zlowred/embd) helps drive adoption. No exceptions +* [Documentation](https://godoc.org/github.com/kidoman/embd) helps drive adoption. No exceptions When it comes to the code: diff --git a/README.md b/README.md index 0d8ba31..f37b5b5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# embd [![Build Status](https://travis-ci.org/kidoman/embd.svg?branch=master)](https://travis-ci.org/kidoman/embd) [![GoDoc](http://godoc.org/github.com/zlowred/embd?status.png)](http://godoc.org/github.com/zlowred/embd) +# embd [![Build Status](https://travis-ci.org/kidoman/embd.svg?branch=master)](https://travis-ci.org/kidoman/embd) [![GoDoc](http://godoc.org/github.com/kidoman/embd?status.png)](http://godoc.org/github.com/kidoman/embd) **embd** is a hardware abstraction layer (HAL) for embedded systems. @@ -6,7 +6,7 @@ It allows you to start your hardware hack on easily available hobby boards (like Development supported and sponsored by [**SoStronk**](https://www.sostronk.com) and [**ThoughtWorks**](http://www.thoughtworks.com/) -Also, you might be interested in: [Why Golang?](https://github.com/zlowred/embd/wiki/Why-Go) +Also, you might be interested in: [Why Golang?](https://github.com/kidoman/embd/wiki/Why-Go) [Blog post introducing EMBD](http://kidoman.io/framework/embd.html) @@ -20,8 +20,8 @@ package main import ( "time" - "github.com/zlowred/embd" - _ "github.com/zlowred/embd/host/rpi" // This loads the RPi driver + "github.com/kidoman/embd" + _ "github.com/kidoman/embd/host/rpi" // This loads the RPi driver ) func main() { @@ -34,7 +34,7 @@ func main() { Then install the EMBD package (go1.2 and greater is required): - $ go get github.com/zlowred/embd + $ go get github.com/kidoman/embd Build the binary*: @@ -58,7 +58,7 @@ Then run the program with ```sudo```*: * We are instructing the ```go``` compiler to create a binary which will run on the RaspberryPi processor * Assuming your RaspberryPi has an IP address of ```192.168.2.2```. Substitute as necessary * ```sudo``` (root) permission is required as we are controlling the hardware by writing to special files -* This sample program is optimized for brevity and does not clean up after itself. Click here to see the [full version](https://github.com/zlowred/embd/blob/master/samples/fullblinker.go) +* This sample program is optimized for brevity and does not clean up after itself. Click here to see the [full version](https://github.com/kidoman/embd/blob/master/samples/fullblinker.go) ## Getting Help @@ -76,7 +76,7 @@ Join the [mailing list](https://groups.google.com/forum/#!forum/go-embd) ## The command line tool - go get github.com/zlowred/embd/embd + go get github.com/kidoman/embd/embd will install a command line utility ```embd``` which will allow you to quickly get started with prototyping. The binary should be available in your ```$GOPATH/bin```. However, to be able to run this on a ARM based device, you will need to build it with ```GOOS=linux``` and ```GOARCH=arm``` environment variables set. @@ -96,14 +96,14 @@ Package **embd** provides a hardware abstraction layer for doing embedded progra on supported platforms like the Raspberry Pi and BeagleBone Black. Most of the examples below will work without change (i.e. the same binary) on all supported platforms. How cool is that? -Although samples are all present in the [samples](https://github.com/zlowred/embd/tree/master/samples) folder, +Although samples are all present in the [samples](https://github.com/kidoman/embd/tree/master/samples) folder, we will show a few choice examples here. Use the **LED** driver to toggle LEDs on the BBB: ```go -import "github.com/zlowred/embd" -import _ "github.com/zlowred/embd/host/all" +import "github.com/kidoman/embd" +import _ "github.com/kidoman/embd/host/all" ... embd.InitLED() defer embd.CloseLED() @@ -116,8 +116,8 @@ led.Toggle() Even shorter when quickly trying things out: ```go -import "github.com/zlowred/embd" -import _ "github.com/zlowred/embd/host/all" +import "github.com/kidoman/embd" +import _ "github.com/kidoman/embd/host/all" ... embd.InitLED() defer embd.CloseLED() @@ -130,8 +130,8 @@ embd.ToggleLED(3) BBB + **PWM**: ```go -import "github.com/zlowred/embd" -import _ "github.com/zlowred/embd/host/all" +import "github.com/kidoman/embd" +import _ "github.com/kidoman/embd/host/all" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -145,8 +145,8 @@ pwm.SetDuty(1000) Control **GPIO** pins on the RaspberryPi / BeagleBone Black: ```go -import "github.com/zlowred/embd" -import _ "github.com/zlowred/embd/host/all" +import "github.com/kidoman/embd" +import _ "github.com/kidoman/embd/host/all" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -158,8 +158,8 @@ embd.DigitalWrite(10, embd.High) Could also do: ```go -import "github.com/zlowred/embd" -import _ "github.com/zlowred/embd/host/all" +import "github.com/kidoman/embd" +import _ "github.com/kidoman/embd/host/all" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -173,9 +173,9 @@ pin.Write(embd.High) Or read data from the **Bosch BMP085** barometric sensor: ```go -import "github.com/zlowred/embd" -import "github.com/zlowred/embd/sensor/bmp085" -import _ "github.com/zlowred/embd/host/all" +import "github.com/kidoman/embd" +import "github.com/kidoman/embd/sensor/bmp085" +import _ "github.com/kidoman/embd/host/all" ... bus := embd.NewI2CBus(1) ... @@ -188,9 +188,9 @@ altitude, err := baro.Altitude() Even find out the heading from the **LSM303** magnetometer: ```go -import "github.com/zlowred/embd" -import "github.com/zlowred/embd/sensor/lsm303" -import _ "github.com/zlowred/embd/host/all" +import "github.com/kidoman/embd" +import "github.com/kidoman/embd/sensor/lsm303" +import _ "github.com/kidoman/embd/host/all" ... bus := embd.NewI2CBus(1) ... @@ -204,28 +204,28 @@ platforms. ## Protocols Supported -* **Digital GPIO** [Documentation](http://godoc.org/github.com/zlowred/embd#DigitalPin) -* **Analog GPIO** [Documentation](http://godoc.org/github.com/zlowred/embd#AnalogPin) -* **PWM** [Documentation](http://godoc.org/github.com/zlowred/embd#PWMPin) -* **I2C** [Documentation](http://godoc.org/github.com/zlowred/embd#I2CBus) -* **LED** [Documentation](http://godoc.org/github.com/zlowred/embd#LED) -* **SPI** [Documentation](http://godoc.org/github.com/zlowred/embd#SPIBus) +* **Digital GPIO** [Documentation](http://godoc.org/github.com/kidoman/embd#DigitalPin) +* **Analog GPIO** [Documentation](http://godoc.org/github.com/kidoman/embd#AnalogPin) +* **PWM** [Documentation](http://godoc.org/github.com/kidoman/embd#PWMPin) +* **I2C** [Documentation](http://godoc.org/github.com/kidoman/embd#I2CBus) +* **LED** [Documentation](http://godoc.org/github.com/kidoman/embd#LED) +* **SPI** [Documentation](http://godoc.org/github.com/kidoman/embd#SPIBus) ## Sensors Supported -* **TMP006** Thermopile sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/tmp006), [Datasheet](http://www.adafruit.com/datasheets/tmp006.pdf), [Userguide](http://www.adafruit.com/datasheets/tmp006ug.pdf) +* **TMP006** Thermopile sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/tmp006), [Datasheet](http://www.adafruit.com/datasheets/tmp006.pdf), [Userguide](http://www.adafruit.com/datasheets/tmp006ug.pdf) -* **BMP085** Barometric pressure sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/bmp085), [Datasheet](https://www.sparkfun.com/datasheets/Components/General/BST-BMP085-DS000-05.pdf) +* **BMP085** Barometric pressure sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/bmp085), [Datasheet](https://www.sparkfun.com/datasheets/Components/General/BST-BMP085-DS000-05.pdf) -* **BMP180** Barometric pressure sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/bmp180), [Datasheet](http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf) +* **BMP180** Barometric pressure sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/bmp180), [Datasheet](http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf) -* **LSM303** Accelerometer and magnetometer [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/lsm303), [Datasheet](https://www.sparkfun.com/datasheets/Sensors/Magneto/LSM303%20Datasheet.pdf) +* **LSM303** Accelerometer and magnetometer [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/lsm303), [Datasheet](https://www.sparkfun.com/datasheets/Sensors/Magneto/LSM303%20Datasheet.pdf) -* **L3GD20** Gyroscope [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/l3gd20), [Datasheet](http://www.adafruit.com/datasheets/L3GD20.pdf) +* **L3GD20** Gyroscope [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/l3gd20), [Datasheet](http://www.adafruit.com/datasheets/L3GD20.pdf) -* **US020** Ultrasonic proximity sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/us020), [Product Page](http://www.digibay.in/sensor/object-detection-and-proximity?product_id=239) +* **US020** Ultrasonic proximity sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/us020), [Product Page](http://www.digibay.in/sensor/object-detection-and-proximity?product_id=239) -* **BH1750FVI** Luminosity sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/bh1750fvi), [Datasheet](http://www.elechouse.com/elechouse/images/product/Digital%20light%20Sensor/bh1750fvi-e.pdf) +* **BH1750FVI** Luminosity sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/bh1750fvi), [Datasheet](http://www.elechouse.com/elechouse/images/product/Digital%20light%20Sensor/bh1750fvi-e.pdf) ## Interfaces @@ -233,11 +233,11 @@ platforms. ## Controllers -* **PCA9685** 16-channel, 12-bit PWM Controller with I2C protocol [Documentation](http://godoc.org/github.com/zlowred/embd/controller/pca9685), [Datasheet](http://www.adafruit.com/datasheets/PCA9685.pdf), [Product Page](http://www.adafruit.com/products/815) +* **PCA9685** 16-channel, 12-bit PWM Controller with I2C protocol [Documentation](http://godoc.org/github.com/kidoman/embd/controller/pca9685), [Datasheet](http://www.adafruit.com/datasheets/PCA9685.pdf), [Product Page](http://www.adafruit.com/products/815) -* **MCP4725** 12-bit DAC [Documentation](http://godoc.org/github.com/zlowred/embd/controller/mcp4725), [Datasheet](http://www.adafruit.com/datasheets/mcp4725.pdf), [Product Page](http://www.adafruit.com/products/935) +* **MCP4725** 12-bit DAC [Documentation](http://godoc.org/github.com/kidoman/embd/controller/mcp4725), [Datasheet](http://www.adafruit.com/datasheets/mcp4725.pdf), [Product Page](http://www.adafruit.com/products/935) -* **ServoBlaster** RPi PWM/PCM based PWM controller [Documentation](http://godoc.org/github.com/zlowred/embd/controller/servoblaster), [Product Page](https://github.com/richardghirst/PiBits/tree/master/ServoBlaster) +* **ServoBlaster** RPi PWM/PCM based PWM controller [Documentation](http://godoc.org/github.com/kidoman/embd/controller/servoblaster), [Product Page](https://github.com/richardghirst/PiBits/tree/master/ServoBlaster) ## Convertors @@ -245,10 +245,10 @@ platforms. ## Contributing -We look forward to your pull requests, but contributions which abide by the [guidelines](https://github.com/zlowred/embd/blob/master/CONTRIBUTING.md) will get a free beer! +We look forward to your pull requests, but contributions which abide by the [guidelines](https://github.com/kidoman/embd/blob/master/CONTRIBUTING.md) will get a free beer! -File an [issue](https://github.com/zlowred/embd/issues), open a [pull request](https://github.com/zlowred/embd/pulls). We are waiting. +File an [issue](https://github.com/kidoman/embd/issues), open a [pull request](https://github.com/kidoman/embd/pulls). We are waiting. ## About -EMBD is affectionately designed/developed by Karan Misra ([kidoman](https://github.com/kidoman)), Kunal Powar ([kunalpowar](https://github.com/kunalpowar)) and [FRIENDS](https://github.com/zlowred/embd/blob/master/AUTHORS). We also have a list of [CONTRIBUTORS](https://github.com/zlowred/embd/blob/master/CONTRIBUTORS). +EMBD is affectionately designed/developed by Karan Misra ([kidoman](https://github.com/kidoman)), Kunal Powar ([kunalpowar](https://github.com/kunalpowar)) and [FRIENDS](https://github.com/kidoman/embd/blob/master/AUTHORS). We also have a list of [CONTRIBUTORS](https://github.com/kidoman/embd/blob/master/CONTRIBUTORS). diff --git a/controller/hd44780/hd44780.go b/controller/hd44780/hd44780.go index 5e12430..88032d5 100644 --- a/controller/hd44780/hd44780.go +++ b/controller/hd44780/hd44780.go @@ -16,7 +16,7 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) type entryMode byte diff --git a/controller/hd44780/hd44780_test.go b/controller/hd44780/hd44780_test.go index 34ef629..b05dddc 100644 --- a/controller/hd44780/hd44780_test.go +++ b/controller/hd44780/hd44780_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/controller/mcp4725/mcp4725.go b/controller/mcp4725/mcp4725.go index 8727a54..1dcaa91 100644 --- a/controller/mcp4725/mcp4725.go +++ b/controller/mcp4725/mcp4725.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/controller/pca9685/pca9685.go b/controller/pca9685/pca9685.go index 20a2966..9a9407d 100644 --- a/controller/pca9685/pca9685.go +++ b/controller/pca9685/pca9685.go @@ -7,8 +7,8 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" - "github.com/zlowred/embd/util" + "github.com/kidoman/embd" + "github.com/kidoman/embd/util" ) const ( diff --git a/convertors/mcp3008/mcp3008.go b/convertors/mcp3008/mcp3008.go index d363fe7..e5ecb99 100644 --- a/convertors/mcp3008/mcp3008.go +++ b/convertors/mcp3008/mcp3008.go @@ -3,7 +3,7 @@ package mcp3008 import ( "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) // MCP3008 represents a mcp3008 8bit DAC. diff --git a/detect.go b/detect.go index 3eb6f1d..a92ff4e 100644 --- a/detect.go +++ b/detect.go @@ -122,6 +122,6 @@ func DetectHost() (host Host, rev int, err error) { case strings.Contains(hardware, "BCM2708") || strings.Contains(hardware, "BCM2709"): return HostRPi, rev, nil default: - return HostNull, 0, fmt.Errorf(`embd: your host "%v:%v" is not supported at this moment. request support at https://github.com/zlowred/embd/issues`, host, model) + return HostNull, 0, fmt.Errorf(`embd: your host "%v:%v" is not supported at this moment. request support at https://github.com/kidoman/embd/issues`, host, model) } } diff --git a/doc.go b/doc.go index 0b05449..80118d4 100644 --- a/doc.go +++ b/doc.go @@ -7,7 +7,7 @@ Use the LED driver to toggle LEDs on the BBB: - import "github.com/zlowred/embd" + import "github.com/kidoman/embd" ... embd.InitLED() defer embd.CloseLED() @@ -18,7 +18,7 @@ Even shorter while prototyping: - import "github.com/zlowred/embd" + import "github.com/kidoman/embd" ... embd.InitLED() defer embd.CloseLED() @@ -27,7 +27,7 @@ BBB + PWM: - import "github.com/zlowred/embd" + import "github.com/kidoman/embd" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -39,7 +39,7 @@ Control GPIO pins on the RaspberryPi / BeagleBone Black: - import "github.com/zlowred/embd" + import "github.com/kidoman/embd" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -49,7 +49,7 @@ Could also do: - import "github.com/zlowred/embd" + import "github.com/kidoman/embd" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -61,8 +61,8 @@ Or read data from the Bosch BMP085 barometric sensor: - import "github.com/zlowred/embd" - import "github.com/zlowred/embd/sensor/bmp085" + import "github.com/kidoman/embd" + import "github.com/kidoman/embd/sensor/bmp085" ... bus := embd.NewI2CBus(1) ... @@ -73,8 +73,8 @@ Even find out the heading from the LSM303 magnetometer: - import "github.com/zlowred/embd" - import "github.com/zlowred/embd/sensor/lsm303" + import "github.com/kidoman/embd" + import "github.com/kidoman/embd/sensor/lsm303" ... bus := embd.NewI2CBus(1) ... diff --git a/embd/detect.go b/embd/detect.go index 671543f..6659980 100644 --- a/embd/detect.go +++ b/embd/detect.go @@ -5,7 +5,7 @@ import ( "os" "github.com/codegangsta/cli" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) func detect(c *cli.Context) { diff --git a/embd/main.go b/embd/main.go index 67082e6..7ea7424 100644 --- a/embd/main.go +++ b/embd/main.go @@ -4,7 +4,7 @@ import ( "os" "github.com/codegangsta/cli" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) var version = "0.1.0" diff --git a/host/all/all.go b/host/all/all.go index e29411c..5bfd7a9 100644 --- a/host/all/all.go +++ b/host/all/all.go @@ -2,6 +2,6 @@ package all import ( - _ "github.com/zlowred/embd/host/bbb" - _ "github.com/zlowred/embd/host/rpi" + _ "github.com/kidoman/embd/host/bbb" + _ "github.com/kidoman/embd/host/rpi" ) diff --git a/host/bbb/analogpin.go b/host/bbb/analogpin.go index 2326601..e12b9dd 100644 --- a/host/bbb/analogpin.go +++ b/host/bbb/analogpin.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) type analogPin struct { diff --git a/host/bbb/analogpin_test.go b/host/bbb/analogpin_test.go index 702e41d..49f22cb 100644 --- a/host/bbb/analogpin_test.go +++ b/host/bbb/analogpin_test.go @@ -3,7 +3,7 @@ package bbb import ( "testing" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) func TestAnalogPinClose(t *testing.T) { diff --git a/host/bbb/bbb.go b/host/bbb/bbb.go index c9ccf27..f909627 100644 --- a/host/bbb/bbb.go +++ b/host/bbb/bbb.go @@ -16,8 +16,8 @@ import ( "strings" "github.com/golang/glog" - "github.com/zlowred/embd" - "github.com/zlowred/embd/host/generic" + "github.com/kidoman/embd" + "github.com/kidoman/embd/host/generic" ) var pins = embd.PinMap{ diff --git a/host/bbb/pwmpin.go b/host/bbb/pwmpin.go index 73cc81b..1bd6c95 100644 --- a/host/bbb/pwmpin.go +++ b/host/bbb/pwmpin.go @@ -11,8 +11,8 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" - "github.com/zlowred/embd/util" + "github.com/kidoman/embd" + "github.com/kidoman/embd/util" ) const ( diff --git a/host/bbb/pwmpin_test.go b/host/bbb/pwmpin_test.go index fd27b9c..1c07ff3 100644 --- a/host/bbb/pwmpin_test.go +++ b/host/bbb/pwmpin_test.go @@ -3,7 +3,7 @@ package bbb import ( "testing" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) func TestPWMPinClose(t *testing.T) { diff --git a/host/generic/digitalpin.go b/host/generic/digitalpin.go index 2dbb252..80a81ea 100644 --- a/host/generic/digitalpin.go +++ b/host/generic/digitalpin.go @@ -12,7 +12,7 @@ import ( "strconv" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) type digitalPin struct { diff --git a/host/generic/digitalpin_test.go b/host/generic/digitalpin_test.go index df5c99e..18e900e 100644 --- a/host/generic/digitalpin_test.go +++ b/host/generic/digitalpin_test.go @@ -3,7 +3,7 @@ package generic import ( "testing" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) func TestDigitalPinClose(t *testing.T) { diff --git a/host/generic/i2cbus.go b/host/generic/i2cbus.go index 1cb10d4..dc8e74c 100644 --- a/host/generic/i2cbus.go +++ b/host/generic/i2cbus.go @@ -12,7 +12,7 @@ import ( "unsafe" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/host/generic/interrupt.go b/host/generic/interrupt.go index 3eba081..4052283 100644 --- a/host/generic/interrupt.go +++ b/host/generic/interrupt.go @@ -8,7 +8,7 @@ import ( "sync" "syscall" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/host/generic/led.go b/host/generic/led.go index 21826bc..67f56c9 100644 --- a/host/generic/led.go +++ b/host/generic/led.go @@ -8,7 +8,7 @@ import ( "os" "strings" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) type led struct { diff --git a/host/generic/spibus.go b/host/generic/spibus.go index 99755ab..ad3bcec 100644 --- a/host/generic/spibus.go +++ b/host/generic/spibus.go @@ -8,7 +8,7 @@ import ( "unsafe" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/host/rpi/onewirebus.go b/host/rpi/onewirebus.go index 48e4d0d..aa19fd3 100644 --- a/host/rpi/onewirebus.go +++ b/host/rpi/onewirebus.go @@ -8,7 +8,7 @@ import ( "sync" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" "io/ioutil" ) diff --git a/host/rpi/rpi.go b/host/rpi/rpi.go index 84acb1b..53866e1 100644 --- a/host/rpi/rpi.go +++ b/host/rpi/rpi.go @@ -5,13 +5,14 @@ GPIO (digital (rw)) I²C LED - W1 - make sure that w1-gpio kernel module is loaded. If you wish to use it with sensors directly (e.g. DS18B20 etc) make sure to disable respective kernel modules (e.g. w1-therm) in /etc/modprobe.d/blacklist.conf. + W1 - make sure that w1-gpio kernel module is loaded. If you wish to use it with sensors directly (e.g. DS18B20 etc) + make sure to disable respective kernel modules (e.g. w1-therm) in /etc/modprobe.d/blacklist.conf. */ package rpi import ( - "github.com/zlowred/embd" - "github.com/zlowred/embd/host/generic" + "github.com/kidoman/embd" + "github.com/kidoman/embd/host/generic" "fmt" ) diff --git a/interface/keypad/matrix4x3/matrix4x3.go b/interface/keypad/matrix4x3/matrix4x3.go index cb268b4..6ef984f 100644 --- a/interface/keypad/matrix4x3/matrix4x3.go +++ b/interface/keypad/matrix4x3/matrix4x3.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) type Key int diff --git a/motion/servo/servo.go b/motion/servo/servo.go index 5bb51f9..c0876d2 100644 --- a/motion/servo/servo.go +++ b/motion/servo/servo.go @@ -3,7 +3,7 @@ package servo import ( "github.com/golang/glog" - "github.com/zlowred/embd/util" + "github.com/kidoman/embd/util" ) const ( diff --git a/samples/28bjy-48.go b/samples/28bjy-48.go index f49be5f..456b7db 100644 --- a/samples/28bjy-48.go +++ b/samples/28bjy-48.go @@ -18,8 +18,8 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" - _ "github.com/zlowred/embd/host/rpi" + "github.com/kidoman/embd" + _ "github.com/kidoman/embd/host/rpi" ) func main() { diff --git a/samples/analog.go b/samples/analog.go index b935e2a..687ecd5 100644 --- a/samples/analog.go +++ b/samples/analog.go @@ -9,9 +9,9 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/analogshort.go b/samples/analogshort.go index 501224a..064be32 100644 --- a/samples/analogshort.go +++ b/samples/analogshort.go @@ -6,9 +6,9 @@ import ( "flag" "fmt" - "github.com/zlowred/embd" + "github.com/kidoman/embd" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/bh1750fvi.go b/samples/bh1750fvi.go index 1b7139a..83e9a72 100644 --- a/samples/bh1750fvi.go +++ b/samples/bh1750fvi.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/sensor/bh1750fvi" + "github.com/kidoman/embd" + "github.com/kidoman/embd/sensor/bh1750fvi" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/bmp085.go b/samples/bmp085.go index 7860a39..0fa56ad 100644 --- a/samples/bmp085.go +++ b/samples/bmp085.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/sensor/bmp085" + "github.com/kidoman/embd" + "github.com/kidoman/embd/sensor/bmp085" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/bmp180.go b/samples/bmp180.go index f39ae2b..845e771 100644 --- a/samples/bmp180.go +++ b/samples/bmp180.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/sensor/bmp180" + "github.com/kidoman/embd" + "github.com/kidoman/embd/sensor/bmp180" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/characterdisplay.go b/samples/characterdisplay.go index 5b14410..7a054aa 100644 --- a/samples/characterdisplay.go +++ b/samples/characterdisplay.go @@ -6,11 +6,11 @@ import ( "flag" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/controller/hd44780" - "github.com/zlowred/embd/interface/display/characterdisplay" + "github.com/kidoman/embd" + "github.com/kidoman/embd/controller/hd44780" + "github.com/kidoman/embd/interface/display/characterdisplay" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/fullblinker.go b/samples/fullblinker.go index 2e07e39..7e43b36 100644 --- a/samples/fullblinker.go +++ b/samples/fullblinker.go @@ -11,8 +11,8 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" - _ "github.com/zlowred/embd/host/rpi" + "github.com/kidoman/embd" + _ "github.com/kidoman/embd/host/rpi" ) func main() { diff --git a/samples/gpio.go b/samples/gpio.go index ab5c1fa..b3769eb 100644 --- a/samples/gpio.go +++ b/samples/gpio.go @@ -6,9 +6,9 @@ import ( "flag" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/gpiodetect.go b/samples/gpiodetect.go index f709667..8bc5f78 100644 --- a/samples/gpiodetect.go +++ b/samples/gpiodetect.go @@ -6,9 +6,9 @@ import ( "flag" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/gpiodirect.go b/samples/gpiodirect.go index d4d3002..85bd22c 100644 --- a/samples/gpiodirect.go +++ b/samples/gpiodirect.go @@ -6,9 +6,9 @@ import ( "flag" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/gpiointerrupt.go b/samples/gpiointerrupt.go index ebf4386..9b6ccc9 100644 --- a/samples/gpiointerrupt.go +++ b/samples/gpiointerrupt.go @@ -6,9 +6,9 @@ import ( "flag" "fmt" - "github.com/zlowred/embd" + "github.com/kidoman/embd" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/gpioshort.go b/samples/gpioshort.go index a05c449..b1c5c2c 100644 --- a/samples/gpioshort.go +++ b/samples/gpioshort.go @@ -5,9 +5,9 @@ package main import ( "flag" - "github.com/zlowred/embd" + "github.com/kidoman/embd" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/hd44780.go b/samples/hd44780.go index aecd01d..418fa7e 100644 --- a/samples/hd44780.go +++ b/samples/hd44780.go @@ -6,10 +6,10 @@ import ( "flag" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/controller/hd44780" + "github.com/kidoman/embd" + "github.com/kidoman/embd/controller/hd44780" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/keypad/matrix4x3.go b/samples/keypad/matrix4x3.go index 9d54dea..9b4feda 100644 --- a/samples/keypad/matrix4x3.go +++ b/samples/keypad/matrix4x3.go @@ -5,8 +5,8 @@ package main import ( "fmt" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/interface/keypad/matrix4x3" + "github.com/kidoman/embd" + "github.com/kidoman/embd/interface/keypad/matrix4x3" ) func main() { diff --git a/samples/l3gd20.go b/samples/l3gd20.go index 2710d39..f0a94e6 100644 --- a/samples/l3gd20.go +++ b/samples/l3gd20.go @@ -9,10 +9,10 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/sensor/l3gd20" + "github.com/kidoman/embd" + "github.com/kidoman/embd/sensor/l3gd20" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/led.go b/samples/led.go index 6cacd1e..82650d0 100644 --- a/samples/led.go +++ b/samples/led.go @@ -11,9 +11,9 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" - _ "github.com/zlowred/embd/host/bbb" + _ "github.com/kidoman/embd/host/bbb" ) func main() { diff --git a/samples/ledshort.go b/samples/ledshort.go index 8cd2c2c..64a01ce 100644 --- a/samples/ledshort.go +++ b/samples/ledshort.go @@ -8,9 +8,9 @@ import ( "flag" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" - _ "github.com/zlowred/embd/host/bbb" + _ "github.com/kidoman/embd/host/bbb" ) func main() { diff --git a/samples/lsm303.go b/samples/lsm303.go index d08b11b..e4461de 100644 --- a/samples/lsm303.go +++ b/samples/lsm303.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/sensor/lsm303" + "github.com/kidoman/embd" + "github.com/kidoman/embd/sensor/lsm303" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/mcp3008.go b/samples/mcp3008.go index eedf3be..791d56a 100644 --- a/samples/mcp3008.go +++ b/samples/mcp3008.go @@ -8,9 +8,9 @@ import ( "fmt" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/convertors/mcp3008" - _ "github.com/zlowred/embd/host/all" + "github.com/kidoman/embd" + "github.com/kidoman/embd/convertors/mcp3008" + _ "github.com/kidoman/embd/host/all" ) const ( diff --git a/samples/mcp4725.go b/samples/mcp4725.go index 7dbc8f7..ad80967 100644 --- a/samples/mcp4725.go +++ b/samples/mcp4725.go @@ -9,10 +9,10 @@ import ( "os" "os/signal" - "github.com/zlowred/embd" - "github.com/zlowred/embd/controller/mcp4725" + "github.com/kidoman/embd" + "github.com/kidoman/embd/controller/mcp4725" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/onewire.go b/samples/onewire.go index e213bb3..e4e907b 100644 --- a/samples/onewire.go +++ b/samples/onewire.go @@ -5,8 +5,8 @@ package main import ( "fmt" - "github.com/zlowred/embd" - _ "github.com/zlowred/embd/host/all" + "github.com/kidoman/embd" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/pca9685.go b/samples/pca9685.go index aca5db3..9976340 100644 --- a/samples/pca9685.go +++ b/samples/pca9685.go @@ -8,10 +8,10 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/controller/pca9685" + "github.com/kidoman/embd" + "github.com/kidoman/embd/controller/pca9685" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/pwm.go b/samples/pwm.go index 86f62f3..cecbc4d 100644 --- a/samples/pwm.go +++ b/samples/pwm.go @@ -8,10 +8,10 @@ import ( "flag" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/host/bbb" + "github.com/kidoman/embd" + "github.com/kidoman/embd/host/bbb" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/servo.go b/samples/servo.go index a451d97..2e82dd8 100644 --- a/samples/servo.go +++ b/samples/servo.go @@ -8,11 +8,11 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/controller/pca9685" - "github.com/zlowred/embd/motion/servo" + "github.com/kidoman/embd" + "github.com/kidoman/embd/controller/pca9685" + "github.com/kidoman/embd/motion/servo" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/servobbb.go b/samples/servobbb.go index ba4ecdd..fbf0db1 100644 --- a/samples/servobbb.go +++ b/samples/servobbb.go @@ -8,10 +8,10 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/motion/servo" + "github.com/kidoman/embd" + "github.com/kidoman/embd/motion/servo" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/servoblaster.go b/samples/servoblaster.go index 777c673..b2d4cdf 100644 --- a/samples/servoblaster.go +++ b/samples/servoblaster.go @@ -8,10 +8,10 @@ import ( "os/signal" "time" - "github.com/zlowred/embd/controller/servoblaster" - "github.com/zlowred/embd/motion/servo" + "github.com/kidoman/embd/controller/servoblaster" + "github.com/kidoman/embd/motion/servo" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/simpleblinker.go b/samples/simpleblinker.go index 8ef0e5a..9e4f780 100644 --- a/samples/simpleblinker.go +++ b/samples/simpleblinker.go @@ -8,8 +8,8 @@ package main import ( "time" - "github.com/zlowred/embd" - _ "github.com/zlowred/embd/host/rpi" // This loads the RPi driver + "github.com/kidoman/embd" + _ "github.com/kidoman/embd/host/rpi" // This loads the RPi driver ) func main() { diff --git a/samples/spi.go b/samples/spi.go index 8a76c0d..298acc4 100644 --- a/samples/spi.go +++ b/samples/spi.go @@ -5,8 +5,8 @@ package main import ( "fmt" - "github.com/zlowred/embd" - _ "github.com/zlowred/embd/host/all" + "github.com/kidoman/embd" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/spimcp3008.go b/samples/spimcp3008.go index fee3274..394243e 100644 --- a/samples/spimcp3008.go +++ b/samples/spimcp3008.go @@ -7,8 +7,8 @@ import ( "fmt" "time" - "github.com/zlowred/embd" - _ "github.com/zlowred/embd/host/all" + "github.com/kidoman/embd" + _ "github.com/kidoman/embd/host/all" ) const ( diff --git a/samples/tmp006.go b/samples/tmp006.go index 2ce5190..6252b00 100644 --- a/samples/tmp006.go +++ b/samples/tmp006.go @@ -8,10 +8,10 @@ import ( "os" "os/signal" - "github.com/zlowred/embd" - "github.com/zlowred/embd/sensor/tmp006" + "github.com/kidoman/embd" + "github.com/kidoman/embd/sensor/tmp006" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/universalblinker.go b/samples/universalblinker.go index 03f2ccd..190ae1d 100644 --- a/samples/universalblinker.go +++ b/samples/universalblinker.go @@ -10,8 +10,8 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" - _ "github.com/zlowred/embd/host/all" + "github.com/kidoman/embd" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/us020.go b/samples/us020.go index 7406b7c..f0e7537 100644 --- a/samples/us020.go +++ b/samples/us020.go @@ -9,10 +9,10 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/sensor/us020" + "github.com/kidoman/embd" + "github.com/kidoman/embd/sensor/us020" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/watersensor.go b/samples/watersensor.go index 4890a60..ff4ba8a 100644 --- a/samples/watersensor.go +++ b/samples/watersensor.go @@ -7,10 +7,10 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" - "github.com/zlowred/embd/sensor/watersensor" + "github.com/kidoman/embd" + "github.com/kidoman/embd/sensor/watersensor" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/sensor/bh1750fvi/bh1750fvi.go b/sensor/bh1750fvi/bh1750fvi.go index f774211..6903bb8 100644 --- a/sensor/bh1750fvi/bh1750fvi.go +++ b/sensor/bh1750fvi/bh1750fvi.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) //accuracy = sensorValue/actualValue] (min = 0.96, typ = 1.2, max = 1.44 diff --git a/sensor/bmp085/bmp085.go b/sensor/bmp085/bmp085.go index c8c184d..b58b37b 100644 --- a/sensor/bmp085/bmp085.go +++ b/sensor/bmp085/bmp085.go @@ -8,7 +8,7 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/sensor/bmp180/bmp180.go b/sensor/bmp180/bmp180.go index bcab5b3..fdc46f3 100644 --- a/sensor/bmp180/bmp180.go +++ b/sensor/bmp180/bmp180.go @@ -8,7 +8,7 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/sensor/l3gd20/l3gd20.go b/sensor/l3gd20/l3gd20.go index c59e2c8..c3ad94a 100644 --- a/sensor/l3gd20/l3gd20.go +++ b/sensor/l3gd20/l3gd20.go @@ -8,7 +8,7 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/sensor/lsm303/lsm303.go b/sensor/lsm303/lsm303.go index d390045..583a0a8 100644 --- a/sensor/lsm303/lsm303.go +++ b/sensor/lsm303/lsm303.go @@ -7,7 +7,7 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/sensor/tmp006/tmp006.go b/sensor/tmp006/tmp006.go index f6347e9..842204b 100644 --- a/sensor/tmp006/tmp006.go +++ b/sensor/tmp006/tmp006.go @@ -9,7 +9,7 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/sensor/us020/us020.go b/sensor/us020/us020.go index 83e581b..b7d400a 100644 --- a/sensor/us020/us020.go +++ b/sensor/us020/us020.go @@ -6,7 +6,7 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/sensor/watersensor/watersensor.go b/sensor/watersensor/watersensor.go index 7b1dfe5..c83628e 100644 --- a/sensor/watersensor/watersensor.go +++ b/sensor/watersensor/watersensor.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) // WaterSensor represents a water sensor. From 9c54f052e31b72529fc7bad3e093fa3af914c130 Mon Sep 17 00:00:00 2001 From: Max Matveev Date: Fri, 5 Feb 2016 22:26:32 -0800 Subject: [PATCH 03/10] OneWire bus impl - removed debug println statements --- host/rpi/rpi.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/host/rpi/rpi.go b/host/rpi/rpi.go index 53866e1..aae14b2 100644 --- a/host/rpi/rpi.go +++ b/host/rpi/rpi.go @@ -13,7 +13,6 @@ package rpi import ( "github.com/kidoman/embd" "github.com/kidoman/embd/host/generic" - "fmt" ) var spiDeviceMinor = byte(0) @@ -76,7 +75,6 @@ var ledMap = embd.LEDMap{ } func init() { - fmt.Println("registering RPI") embd.Register(embd.HostRPi, func(rev int) *embd.Descriptor { // Refer to http://elinux.org/RPi_HardwareHistory#Board_Revision_History // for details. @@ -106,5 +104,4 @@ func init() { }, } }) - fmt.Println("registered") } From 5b489bdc8f70dfd69a92c3b8116c775d53b418d6 Mon Sep 17 00:00:00 2001 From: Max Matveev Date: Fri, 5 Feb 2016 22:31:46 -0800 Subject: [PATCH 04/10] Reverted back to the local imports so that OneWire compiles without pull request accepted in the origin --- CONTRIBUTING.md | 2 +- README.md | 86 ++++++++++++------------- controller/hd44780/hd44780.go | 2 +- controller/hd44780/hd44780_test.go | 2 +- controller/mcp4725/mcp4725.go | 2 +- controller/pca9685/pca9685.go | 4 +- convertors/mcp3008/mcp3008.go | 2 +- detect.go | 2 +- doc.go | 18 +++--- embd/detect.go | 2 +- embd/main.go | 2 +- host/all/all.go | 4 +- host/bbb/analogpin.go | 2 +- host/bbb/analogpin_test.go | 2 +- host/bbb/bbb.go | 4 +- host/bbb/pwmpin.go | 4 +- host/bbb/pwmpin_test.go | 2 +- host/generic/digitalpin.go | 2 +- host/generic/digitalpin_test.go | 2 +- host/generic/i2cbus.go | 2 +- host/generic/interrupt.go | 2 +- host/generic/led.go | 2 +- host/generic/spibus.go | 2 +- host/rpi/onewirebus.go | 2 +- host/rpi/rpi.go | 4 +- interface/keypad/matrix4x3/matrix4x3.go | 2 +- motion/servo/servo.go | 2 +- samples/28bjy-48.go | 4 +- samples/analog.go | 4 +- samples/analogshort.go | 4 +- samples/bh1750fvi.go | 6 +- samples/bmp085.go | 6 +- samples/bmp180.go | 6 +- samples/characterdisplay.go | 8 +-- samples/fullblinker.go | 4 +- samples/gpio.go | 4 +- samples/gpiodetect.go | 4 +- samples/gpiodirect.go | 4 +- samples/gpiointerrupt.go | 4 +- samples/gpioshort.go | 4 +- samples/hd44780.go | 6 +- samples/keypad/matrix4x3.go | 4 +- samples/l3gd20.go | 6 +- samples/led.go | 4 +- samples/ledshort.go | 4 +- samples/lsm303.go | 6 +- samples/mcp3008.go | 6 +- samples/mcp4725.go | 6 +- samples/onewire.go | 4 +- samples/pca9685.go | 6 +- samples/pwm.go | 6 +- samples/servo.go | 8 +-- samples/servobbb.go | 6 +- samples/servoblaster.go | 6 +- samples/simpleblinker.go | 4 +- samples/spi.go | 4 +- samples/spimcp3008.go | 4 +- samples/tmp006.go | 6 +- samples/universalblinker.go | 4 +- samples/us020.go | 6 +- samples/watersensor.go | 6 +- sensor/bh1750fvi/bh1750fvi.go | 2 +- sensor/bmp085/bmp085.go | 2 +- sensor/bmp180/bmp180.go | 2 +- sensor/l3gd20/l3gd20.go | 2 +- sensor/lsm303/lsm303.go | 2 +- sensor/tmp006/tmp006.go | 2 +- sensor/us020/us020.go | 2 +- sensor/watersensor/watersensor.go | 2 +- 69 files changed, 177 insertions(+), 177 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 975aca7..b26f838 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ This actually is really simple. A few simple guidelines and we can break for dinner: * EMBD is designed with a lot of affection, with utmost importance given to the dev experience (read: the API feel and style.) So always think from that angle when creating the pull request -* [Documentation](https://godoc.org/github.com/kidoman/embd) helps drive adoption. No exceptions +* [Documentation](https://godoc.org/github.com/zlowred/embd) helps drive adoption. No exceptions When it comes to the code: diff --git a/README.md b/README.md index f37b5b5..0d8ba31 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# embd [![Build Status](https://travis-ci.org/kidoman/embd.svg?branch=master)](https://travis-ci.org/kidoman/embd) [![GoDoc](http://godoc.org/github.com/kidoman/embd?status.png)](http://godoc.org/github.com/kidoman/embd) +# embd [![Build Status](https://travis-ci.org/kidoman/embd.svg?branch=master)](https://travis-ci.org/kidoman/embd) [![GoDoc](http://godoc.org/github.com/zlowred/embd?status.png)](http://godoc.org/github.com/zlowred/embd) **embd** is a hardware abstraction layer (HAL) for embedded systems. @@ -6,7 +6,7 @@ It allows you to start your hardware hack on easily available hobby boards (like Development supported and sponsored by [**SoStronk**](https://www.sostronk.com) and [**ThoughtWorks**](http://www.thoughtworks.com/) -Also, you might be interested in: [Why Golang?](https://github.com/kidoman/embd/wiki/Why-Go) +Also, you might be interested in: [Why Golang?](https://github.com/zlowred/embd/wiki/Why-Go) [Blog post introducing EMBD](http://kidoman.io/framework/embd.html) @@ -20,8 +20,8 @@ package main import ( "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/rpi" // This loads the RPi driver + "github.com/zlowred/embd" + _ "github.com/zlowred/embd/host/rpi" // This loads the RPi driver ) func main() { @@ -34,7 +34,7 @@ func main() { Then install the EMBD package (go1.2 and greater is required): - $ go get github.com/kidoman/embd + $ go get github.com/zlowred/embd Build the binary*: @@ -58,7 +58,7 @@ Then run the program with ```sudo```*: * We are instructing the ```go``` compiler to create a binary which will run on the RaspberryPi processor * Assuming your RaspberryPi has an IP address of ```192.168.2.2```. Substitute as necessary * ```sudo``` (root) permission is required as we are controlling the hardware by writing to special files -* This sample program is optimized for brevity and does not clean up after itself. Click here to see the [full version](https://github.com/kidoman/embd/blob/master/samples/fullblinker.go) +* This sample program is optimized for brevity and does not clean up after itself. Click here to see the [full version](https://github.com/zlowred/embd/blob/master/samples/fullblinker.go) ## Getting Help @@ -76,7 +76,7 @@ Join the [mailing list](https://groups.google.com/forum/#!forum/go-embd) ## The command line tool - go get github.com/kidoman/embd/embd + go get github.com/zlowred/embd/embd will install a command line utility ```embd``` which will allow you to quickly get started with prototyping. The binary should be available in your ```$GOPATH/bin```. However, to be able to run this on a ARM based device, you will need to build it with ```GOOS=linux``` and ```GOARCH=arm``` environment variables set. @@ -96,14 +96,14 @@ Package **embd** provides a hardware abstraction layer for doing embedded progra on supported platforms like the Raspberry Pi and BeagleBone Black. Most of the examples below will work without change (i.e. the same binary) on all supported platforms. How cool is that? -Although samples are all present in the [samples](https://github.com/kidoman/embd/tree/master/samples) folder, +Although samples are all present in the [samples](https://github.com/zlowred/embd/tree/master/samples) folder, we will show a few choice examples here. Use the **LED** driver to toggle LEDs on the BBB: ```go -import "github.com/kidoman/embd" -import _ "github.com/kidoman/embd/host/all" +import "github.com/zlowred/embd" +import _ "github.com/zlowred/embd/host/all" ... embd.InitLED() defer embd.CloseLED() @@ -116,8 +116,8 @@ led.Toggle() Even shorter when quickly trying things out: ```go -import "github.com/kidoman/embd" -import _ "github.com/kidoman/embd/host/all" +import "github.com/zlowred/embd" +import _ "github.com/zlowred/embd/host/all" ... embd.InitLED() defer embd.CloseLED() @@ -130,8 +130,8 @@ embd.ToggleLED(3) BBB + **PWM**: ```go -import "github.com/kidoman/embd" -import _ "github.com/kidoman/embd/host/all" +import "github.com/zlowred/embd" +import _ "github.com/zlowred/embd/host/all" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -145,8 +145,8 @@ pwm.SetDuty(1000) Control **GPIO** pins on the RaspberryPi / BeagleBone Black: ```go -import "github.com/kidoman/embd" -import _ "github.com/kidoman/embd/host/all" +import "github.com/zlowred/embd" +import _ "github.com/zlowred/embd/host/all" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -158,8 +158,8 @@ embd.DigitalWrite(10, embd.High) Could also do: ```go -import "github.com/kidoman/embd" -import _ "github.com/kidoman/embd/host/all" +import "github.com/zlowred/embd" +import _ "github.com/zlowred/embd/host/all" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -173,9 +173,9 @@ pin.Write(embd.High) Or read data from the **Bosch BMP085** barometric sensor: ```go -import "github.com/kidoman/embd" -import "github.com/kidoman/embd/sensor/bmp085" -import _ "github.com/kidoman/embd/host/all" +import "github.com/zlowred/embd" +import "github.com/zlowred/embd/sensor/bmp085" +import _ "github.com/zlowred/embd/host/all" ... bus := embd.NewI2CBus(1) ... @@ -188,9 +188,9 @@ altitude, err := baro.Altitude() Even find out the heading from the **LSM303** magnetometer: ```go -import "github.com/kidoman/embd" -import "github.com/kidoman/embd/sensor/lsm303" -import _ "github.com/kidoman/embd/host/all" +import "github.com/zlowred/embd" +import "github.com/zlowred/embd/sensor/lsm303" +import _ "github.com/zlowred/embd/host/all" ... bus := embd.NewI2CBus(1) ... @@ -204,28 +204,28 @@ platforms. ## Protocols Supported -* **Digital GPIO** [Documentation](http://godoc.org/github.com/kidoman/embd#DigitalPin) -* **Analog GPIO** [Documentation](http://godoc.org/github.com/kidoman/embd#AnalogPin) -* **PWM** [Documentation](http://godoc.org/github.com/kidoman/embd#PWMPin) -* **I2C** [Documentation](http://godoc.org/github.com/kidoman/embd#I2CBus) -* **LED** [Documentation](http://godoc.org/github.com/kidoman/embd#LED) -* **SPI** [Documentation](http://godoc.org/github.com/kidoman/embd#SPIBus) +* **Digital GPIO** [Documentation](http://godoc.org/github.com/zlowred/embd#DigitalPin) +* **Analog GPIO** [Documentation](http://godoc.org/github.com/zlowred/embd#AnalogPin) +* **PWM** [Documentation](http://godoc.org/github.com/zlowred/embd#PWMPin) +* **I2C** [Documentation](http://godoc.org/github.com/zlowred/embd#I2CBus) +* **LED** [Documentation](http://godoc.org/github.com/zlowred/embd#LED) +* **SPI** [Documentation](http://godoc.org/github.com/zlowred/embd#SPIBus) ## Sensors Supported -* **TMP006** Thermopile sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/tmp006), [Datasheet](http://www.adafruit.com/datasheets/tmp006.pdf), [Userguide](http://www.adafruit.com/datasheets/tmp006ug.pdf) +* **TMP006** Thermopile sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/tmp006), [Datasheet](http://www.adafruit.com/datasheets/tmp006.pdf), [Userguide](http://www.adafruit.com/datasheets/tmp006ug.pdf) -* **BMP085** Barometric pressure sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/bmp085), [Datasheet](https://www.sparkfun.com/datasheets/Components/General/BST-BMP085-DS000-05.pdf) +* **BMP085** Barometric pressure sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/bmp085), [Datasheet](https://www.sparkfun.com/datasheets/Components/General/BST-BMP085-DS000-05.pdf) -* **BMP180** Barometric pressure sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/bmp180), [Datasheet](http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf) +* **BMP180** Barometric pressure sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/bmp180), [Datasheet](http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf) -* **LSM303** Accelerometer and magnetometer [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/lsm303), [Datasheet](https://www.sparkfun.com/datasheets/Sensors/Magneto/LSM303%20Datasheet.pdf) +* **LSM303** Accelerometer and magnetometer [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/lsm303), [Datasheet](https://www.sparkfun.com/datasheets/Sensors/Magneto/LSM303%20Datasheet.pdf) -* **L3GD20** Gyroscope [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/l3gd20), [Datasheet](http://www.adafruit.com/datasheets/L3GD20.pdf) +* **L3GD20** Gyroscope [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/l3gd20), [Datasheet](http://www.adafruit.com/datasheets/L3GD20.pdf) -* **US020** Ultrasonic proximity sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/us020), [Product Page](http://www.digibay.in/sensor/object-detection-and-proximity?product_id=239) +* **US020** Ultrasonic proximity sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/us020), [Product Page](http://www.digibay.in/sensor/object-detection-and-proximity?product_id=239) -* **BH1750FVI** Luminosity sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/bh1750fvi), [Datasheet](http://www.elechouse.com/elechouse/images/product/Digital%20light%20Sensor/bh1750fvi-e.pdf) +* **BH1750FVI** Luminosity sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/bh1750fvi), [Datasheet](http://www.elechouse.com/elechouse/images/product/Digital%20light%20Sensor/bh1750fvi-e.pdf) ## Interfaces @@ -233,11 +233,11 @@ platforms. ## Controllers -* **PCA9685** 16-channel, 12-bit PWM Controller with I2C protocol [Documentation](http://godoc.org/github.com/kidoman/embd/controller/pca9685), [Datasheet](http://www.adafruit.com/datasheets/PCA9685.pdf), [Product Page](http://www.adafruit.com/products/815) +* **PCA9685** 16-channel, 12-bit PWM Controller with I2C protocol [Documentation](http://godoc.org/github.com/zlowred/embd/controller/pca9685), [Datasheet](http://www.adafruit.com/datasheets/PCA9685.pdf), [Product Page](http://www.adafruit.com/products/815) -* **MCP4725** 12-bit DAC [Documentation](http://godoc.org/github.com/kidoman/embd/controller/mcp4725), [Datasheet](http://www.adafruit.com/datasheets/mcp4725.pdf), [Product Page](http://www.adafruit.com/products/935) +* **MCP4725** 12-bit DAC [Documentation](http://godoc.org/github.com/zlowred/embd/controller/mcp4725), [Datasheet](http://www.adafruit.com/datasheets/mcp4725.pdf), [Product Page](http://www.adafruit.com/products/935) -* **ServoBlaster** RPi PWM/PCM based PWM controller [Documentation](http://godoc.org/github.com/kidoman/embd/controller/servoblaster), [Product Page](https://github.com/richardghirst/PiBits/tree/master/ServoBlaster) +* **ServoBlaster** RPi PWM/PCM based PWM controller [Documentation](http://godoc.org/github.com/zlowred/embd/controller/servoblaster), [Product Page](https://github.com/richardghirst/PiBits/tree/master/ServoBlaster) ## Convertors @@ -245,10 +245,10 @@ platforms. ## Contributing -We look forward to your pull requests, but contributions which abide by the [guidelines](https://github.com/kidoman/embd/blob/master/CONTRIBUTING.md) will get a free beer! +We look forward to your pull requests, but contributions which abide by the [guidelines](https://github.com/zlowred/embd/blob/master/CONTRIBUTING.md) will get a free beer! -File an [issue](https://github.com/kidoman/embd/issues), open a [pull request](https://github.com/kidoman/embd/pulls). We are waiting. +File an [issue](https://github.com/zlowred/embd/issues), open a [pull request](https://github.com/zlowred/embd/pulls). We are waiting. ## About -EMBD is affectionately designed/developed by Karan Misra ([kidoman](https://github.com/kidoman)), Kunal Powar ([kunalpowar](https://github.com/kunalpowar)) and [FRIENDS](https://github.com/kidoman/embd/blob/master/AUTHORS). We also have a list of [CONTRIBUTORS](https://github.com/kidoman/embd/blob/master/CONTRIBUTORS). +EMBD is affectionately designed/developed by Karan Misra ([kidoman](https://github.com/kidoman)), Kunal Powar ([kunalpowar](https://github.com/kunalpowar)) and [FRIENDS](https://github.com/zlowred/embd/blob/master/AUTHORS). We also have a list of [CONTRIBUTORS](https://github.com/zlowred/embd/blob/master/CONTRIBUTORS). diff --git a/controller/hd44780/hd44780.go b/controller/hd44780/hd44780.go index 88032d5..5e12430 100644 --- a/controller/hd44780/hd44780.go +++ b/controller/hd44780/hd44780.go @@ -16,7 +16,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) type entryMode byte diff --git a/controller/hd44780/hd44780_test.go b/controller/hd44780/hd44780_test.go index b05dddc..34ef629 100644 --- a/controller/hd44780/hd44780_test.go +++ b/controller/hd44780/hd44780_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/controller/mcp4725/mcp4725.go b/controller/mcp4725/mcp4725.go index 1dcaa91..8727a54 100644 --- a/controller/mcp4725/mcp4725.go +++ b/controller/mcp4725/mcp4725.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/controller/pca9685/pca9685.go b/controller/pca9685/pca9685.go index 9a9407d..20a2966 100644 --- a/controller/pca9685/pca9685.go +++ b/controller/pca9685/pca9685.go @@ -7,8 +7,8 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" - "github.com/kidoman/embd/util" + "github.com/zlowred/embd" + "github.com/zlowred/embd/util" ) const ( diff --git a/convertors/mcp3008/mcp3008.go b/convertors/mcp3008/mcp3008.go index e5ecb99..d363fe7 100644 --- a/convertors/mcp3008/mcp3008.go +++ b/convertors/mcp3008/mcp3008.go @@ -3,7 +3,7 @@ package mcp3008 import ( "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) // MCP3008 represents a mcp3008 8bit DAC. diff --git a/detect.go b/detect.go index a92ff4e..3eb6f1d 100644 --- a/detect.go +++ b/detect.go @@ -122,6 +122,6 @@ func DetectHost() (host Host, rev int, err error) { case strings.Contains(hardware, "BCM2708") || strings.Contains(hardware, "BCM2709"): return HostRPi, rev, nil default: - return HostNull, 0, fmt.Errorf(`embd: your host "%v:%v" is not supported at this moment. request support at https://github.com/kidoman/embd/issues`, host, model) + return HostNull, 0, fmt.Errorf(`embd: your host "%v:%v" is not supported at this moment. request support at https://github.com/zlowred/embd/issues`, host, model) } } diff --git a/doc.go b/doc.go index 80118d4..0b05449 100644 --- a/doc.go +++ b/doc.go @@ -7,7 +7,7 @@ Use the LED driver to toggle LEDs on the BBB: - import "github.com/kidoman/embd" + import "github.com/zlowred/embd" ... embd.InitLED() defer embd.CloseLED() @@ -18,7 +18,7 @@ Even shorter while prototyping: - import "github.com/kidoman/embd" + import "github.com/zlowred/embd" ... embd.InitLED() defer embd.CloseLED() @@ -27,7 +27,7 @@ BBB + PWM: - import "github.com/kidoman/embd" + import "github.com/zlowred/embd" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -39,7 +39,7 @@ Control GPIO pins on the RaspberryPi / BeagleBone Black: - import "github.com/kidoman/embd" + import "github.com/zlowred/embd" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -49,7 +49,7 @@ Could also do: - import "github.com/kidoman/embd" + import "github.com/zlowred/embd" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -61,8 +61,8 @@ Or read data from the Bosch BMP085 barometric sensor: - import "github.com/kidoman/embd" - import "github.com/kidoman/embd/sensor/bmp085" + import "github.com/zlowred/embd" + import "github.com/zlowred/embd/sensor/bmp085" ... bus := embd.NewI2CBus(1) ... @@ -73,8 +73,8 @@ Even find out the heading from the LSM303 magnetometer: - import "github.com/kidoman/embd" - import "github.com/kidoman/embd/sensor/lsm303" + import "github.com/zlowred/embd" + import "github.com/zlowred/embd/sensor/lsm303" ... bus := embd.NewI2CBus(1) ... diff --git a/embd/detect.go b/embd/detect.go index 6659980..671543f 100644 --- a/embd/detect.go +++ b/embd/detect.go @@ -5,7 +5,7 @@ import ( "os" "github.com/codegangsta/cli" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) func detect(c *cli.Context) { diff --git a/embd/main.go b/embd/main.go index 7ea7424..67082e6 100644 --- a/embd/main.go +++ b/embd/main.go @@ -4,7 +4,7 @@ import ( "os" "github.com/codegangsta/cli" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) var version = "0.1.0" diff --git a/host/all/all.go b/host/all/all.go index 5bfd7a9..e29411c 100644 --- a/host/all/all.go +++ b/host/all/all.go @@ -2,6 +2,6 @@ package all import ( - _ "github.com/kidoman/embd/host/bbb" - _ "github.com/kidoman/embd/host/rpi" + _ "github.com/zlowred/embd/host/bbb" + _ "github.com/zlowred/embd/host/rpi" ) diff --git a/host/bbb/analogpin.go b/host/bbb/analogpin.go index e12b9dd..2326601 100644 --- a/host/bbb/analogpin.go +++ b/host/bbb/analogpin.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) type analogPin struct { diff --git a/host/bbb/analogpin_test.go b/host/bbb/analogpin_test.go index 49f22cb..702e41d 100644 --- a/host/bbb/analogpin_test.go +++ b/host/bbb/analogpin_test.go @@ -3,7 +3,7 @@ package bbb import ( "testing" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) func TestAnalogPinClose(t *testing.T) { diff --git a/host/bbb/bbb.go b/host/bbb/bbb.go index f909627..c9ccf27 100644 --- a/host/bbb/bbb.go +++ b/host/bbb/bbb.go @@ -16,8 +16,8 @@ import ( "strings" "github.com/golang/glog" - "github.com/kidoman/embd" - "github.com/kidoman/embd/host/generic" + "github.com/zlowred/embd" + "github.com/zlowred/embd/host/generic" ) var pins = embd.PinMap{ diff --git a/host/bbb/pwmpin.go b/host/bbb/pwmpin.go index 1bd6c95..73cc81b 100644 --- a/host/bbb/pwmpin.go +++ b/host/bbb/pwmpin.go @@ -11,8 +11,8 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" - "github.com/kidoman/embd/util" + "github.com/zlowred/embd" + "github.com/zlowred/embd/util" ) const ( diff --git a/host/bbb/pwmpin_test.go b/host/bbb/pwmpin_test.go index 1c07ff3..fd27b9c 100644 --- a/host/bbb/pwmpin_test.go +++ b/host/bbb/pwmpin_test.go @@ -3,7 +3,7 @@ package bbb import ( "testing" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) func TestPWMPinClose(t *testing.T) { diff --git a/host/generic/digitalpin.go b/host/generic/digitalpin.go index 80a81ea..2dbb252 100644 --- a/host/generic/digitalpin.go +++ b/host/generic/digitalpin.go @@ -12,7 +12,7 @@ import ( "strconv" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) type digitalPin struct { diff --git a/host/generic/digitalpin_test.go b/host/generic/digitalpin_test.go index 18e900e..df5c99e 100644 --- a/host/generic/digitalpin_test.go +++ b/host/generic/digitalpin_test.go @@ -3,7 +3,7 @@ package generic import ( "testing" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) func TestDigitalPinClose(t *testing.T) { diff --git a/host/generic/i2cbus.go b/host/generic/i2cbus.go index dc8e74c..1cb10d4 100644 --- a/host/generic/i2cbus.go +++ b/host/generic/i2cbus.go @@ -12,7 +12,7 @@ import ( "unsafe" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/host/generic/interrupt.go b/host/generic/interrupt.go index 4052283..3eba081 100644 --- a/host/generic/interrupt.go +++ b/host/generic/interrupt.go @@ -8,7 +8,7 @@ import ( "sync" "syscall" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/host/generic/led.go b/host/generic/led.go index 67f56c9..21826bc 100644 --- a/host/generic/led.go +++ b/host/generic/led.go @@ -8,7 +8,7 @@ import ( "os" "strings" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) type led struct { diff --git a/host/generic/spibus.go b/host/generic/spibus.go index ad3bcec..99755ab 100644 --- a/host/generic/spibus.go +++ b/host/generic/spibus.go @@ -8,7 +8,7 @@ import ( "unsafe" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/host/rpi/onewirebus.go b/host/rpi/onewirebus.go index aa19fd3..48e4d0d 100644 --- a/host/rpi/onewirebus.go +++ b/host/rpi/onewirebus.go @@ -8,7 +8,7 @@ import ( "sync" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" "io/ioutil" ) diff --git a/host/rpi/rpi.go b/host/rpi/rpi.go index aae14b2..cd424a5 100644 --- a/host/rpi/rpi.go +++ b/host/rpi/rpi.go @@ -11,8 +11,8 @@ package rpi import ( - "github.com/kidoman/embd" - "github.com/kidoman/embd/host/generic" + "github.com/zlowred/embd" + "github.com/zlowred/embd/host/generic" ) var spiDeviceMinor = byte(0) diff --git a/interface/keypad/matrix4x3/matrix4x3.go b/interface/keypad/matrix4x3/matrix4x3.go index 6ef984f..cb268b4 100644 --- a/interface/keypad/matrix4x3/matrix4x3.go +++ b/interface/keypad/matrix4x3/matrix4x3.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) type Key int diff --git a/motion/servo/servo.go b/motion/servo/servo.go index c0876d2..5bb51f9 100644 --- a/motion/servo/servo.go +++ b/motion/servo/servo.go @@ -3,7 +3,7 @@ package servo import ( "github.com/golang/glog" - "github.com/kidoman/embd/util" + "github.com/zlowred/embd/util" ) const ( diff --git a/samples/28bjy-48.go b/samples/28bjy-48.go index 456b7db..f49be5f 100644 --- a/samples/28bjy-48.go +++ b/samples/28bjy-48.go @@ -18,8 +18,8 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/rpi" + "github.com/zlowred/embd" + _ "github.com/zlowred/embd/host/rpi" ) func main() { diff --git a/samples/analog.go b/samples/analog.go index 687ecd5..b935e2a 100644 --- a/samples/analog.go +++ b/samples/analog.go @@ -9,9 +9,9 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/analogshort.go b/samples/analogshort.go index 064be32..501224a 100644 --- a/samples/analogshort.go +++ b/samples/analogshort.go @@ -6,9 +6,9 @@ import ( "flag" "fmt" - "github.com/kidoman/embd" + "github.com/zlowred/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/bh1750fvi.go b/samples/bh1750fvi.go index 83e9a72..1b7139a 100644 --- a/samples/bh1750fvi.go +++ b/samples/bh1750fvi.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/bh1750fvi" + "github.com/zlowred/embd" + "github.com/zlowred/embd/sensor/bh1750fvi" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/bmp085.go b/samples/bmp085.go index 0fa56ad..7860a39 100644 --- a/samples/bmp085.go +++ b/samples/bmp085.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/bmp085" + "github.com/zlowred/embd" + "github.com/zlowred/embd/sensor/bmp085" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/bmp180.go b/samples/bmp180.go index 845e771..f39ae2b 100644 --- a/samples/bmp180.go +++ b/samples/bmp180.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/bmp180" + "github.com/zlowred/embd" + "github.com/zlowred/embd/sensor/bmp180" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/characterdisplay.go b/samples/characterdisplay.go index 7a054aa..5b14410 100644 --- a/samples/characterdisplay.go +++ b/samples/characterdisplay.go @@ -6,11 +6,11 @@ import ( "flag" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/controller/hd44780" - "github.com/kidoman/embd/interface/display/characterdisplay" + "github.com/zlowred/embd" + "github.com/zlowred/embd/controller/hd44780" + "github.com/zlowred/embd/interface/display/characterdisplay" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/fullblinker.go b/samples/fullblinker.go index 7e43b36..2e07e39 100644 --- a/samples/fullblinker.go +++ b/samples/fullblinker.go @@ -11,8 +11,8 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/rpi" + "github.com/zlowred/embd" + _ "github.com/zlowred/embd/host/rpi" ) func main() { diff --git a/samples/gpio.go b/samples/gpio.go index b3769eb..ab5c1fa 100644 --- a/samples/gpio.go +++ b/samples/gpio.go @@ -6,9 +6,9 @@ import ( "flag" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/gpiodetect.go b/samples/gpiodetect.go index 8bc5f78..f709667 100644 --- a/samples/gpiodetect.go +++ b/samples/gpiodetect.go @@ -6,9 +6,9 @@ import ( "flag" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/gpiodirect.go b/samples/gpiodirect.go index 85bd22c..d4d3002 100644 --- a/samples/gpiodirect.go +++ b/samples/gpiodirect.go @@ -6,9 +6,9 @@ import ( "flag" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/gpiointerrupt.go b/samples/gpiointerrupt.go index 9b6ccc9..ebf4386 100644 --- a/samples/gpiointerrupt.go +++ b/samples/gpiointerrupt.go @@ -6,9 +6,9 @@ import ( "flag" "fmt" - "github.com/kidoman/embd" + "github.com/zlowred/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/gpioshort.go b/samples/gpioshort.go index b1c5c2c..a05c449 100644 --- a/samples/gpioshort.go +++ b/samples/gpioshort.go @@ -5,9 +5,9 @@ package main import ( "flag" - "github.com/kidoman/embd" + "github.com/zlowred/embd" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/hd44780.go b/samples/hd44780.go index 418fa7e..aecd01d 100644 --- a/samples/hd44780.go +++ b/samples/hd44780.go @@ -6,10 +6,10 @@ import ( "flag" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/controller/hd44780" + "github.com/zlowred/embd" + "github.com/zlowred/embd/controller/hd44780" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/keypad/matrix4x3.go b/samples/keypad/matrix4x3.go index 9b4feda..9d54dea 100644 --- a/samples/keypad/matrix4x3.go +++ b/samples/keypad/matrix4x3.go @@ -5,8 +5,8 @@ package main import ( "fmt" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/interface/keypad/matrix4x3" + "github.com/zlowred/embd" + "github.com/zlowred/embd/interface/keypad/matrix4x3" ) func main() { diff --git a/samples/l3gd20.go b/samples/l3gd20.go index f0a94e6..2710d39 100644 --- a/samples/l3gd20.go +++ b/samples/l3gd20.go @@ -9,10 +9,10 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/l3gd20" + "github.com/zlowred/embd" + "github.com/zlowred/embd/sensor/l3gd20" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/led.go b/samples/led.go index 82650d0..6cacd1e 100644 --- a/samples/led.go +++ b/samples/led.go @@ -11,9 +11,9 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" - _ "github.com/kidoman/embd/host/bbb" + _ "github.com/zlowred/embd/host/bbb" ) func main() { diff --git a/samples/ledshort.go b/samples/ledshort.go index 64a01ce..8cd2c2c 100644 --- a/samples/ledshort.go +++ b/samples/ledshort.go @@ -8,9 +8,9 @@ import ( "flag" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" - _ "github.com/kidoman/embd/host/bbb" + _ "github.com/zlowred/embd/host/bbb" ) func main() { diff --git a/samples/lsm303.go b/samples/lsm303.go index e4461de..d08b11b 100644 --- a/samples/lsm303.go +++ b/samples/lsm303.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/lsm303" + "github.com/zlowred/embd" + "github.com/zlowred/embd/sensor/lsm303" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/mcp3008.go b/samples/mcp3008.go index 791d56a..eedf3be 100644 --- a/samples/mcp3008.go +++ b/samples/mcp3008.go @@ -8,9 +8,9 @@ import ( "fmt" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/convertors/mcp3008" - _ "github.com/kidoman/embd/host/all" + "github.com/zlowred/embd" + "github.com/zlowred/embd/convertors/mcp3008" + _ "github.com/zlowred/embd/host/all" ) const ( diff --git a/samples/mcp4725.go b/samples/mcp4725.go index ad80967..7dbc8f7 100644 --- a/samples/mcp4725.go +++ b/samples/mcp4725.go @@ -9,10 +9,10 @@ import ( "os" "os/signal" - "github.com/kidoman/embd" - "github.com/kidoman/embd/controller/mcp4725" + "github.com/zlowred/embd" + "github.com/zlowred/embd/controller/mcp4725" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/onewire.go b/samples/onewire.go index e4e907b..e213bb3 100644 --- a/samples/onewire.go +++ b/samples/onewire.go @@ -5,8 +5,8 @@ package main import ( "fmt" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/all" + "github.com/zlowred/embd" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/pca9685.go b/samples/pca9685.go index 9976340..aca5db3 100644 --- a/samples/pca9685.go +++ b/samples/pca9685.go @@ -8,10 +8,10 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/controller/pca9685" + "github.com/zlowred/embd" + "github.com/zlowred/embd/controller/pca9685" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/pwm.go b/samples/pwm.go index cecbc4d..86f62f3 100644 --- a/samples/pwm.go +++ b/samples/pwm.go @@ -8,10 +8,10 @@ import ( "flag" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/host/bbb" + "github.com/zlowred/embd" + "github.com/zlowred/embd/host/bbb" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/servo.go b/samples/servo.go index 2e82dd8..a451d97 100644 --- a/samples/servo.go +++ b/samples/servo.go @@ -8,11 +8,11 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/controller/pca9685" - "github.com/kidoman/embd/motion/servo" + "github.com/zlowred/embd" + "github.com/zlowred/embd/controller/pca9685" + "github.com/zlowred/embd/motion/servo" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/servobbb.go b/samples/servobbb.go index fbf0db1..ba4ecdd 100644 --- a/samples/servobbb.go +++ b/samples/servobbb.go @@ -8,10 +8,10 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/motion/servo" + "github.com/zlowred/embd" + "github.com/zlowred/embd/motion/servo" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/servoblaster.go b/samples/servoblaster.go index b2d4cdf..777c673 100644 --- a/samples/servoblaster.go +++ b/samples/servoblaster.go @@ -8,10 +8,10 @@ import ( "os/signal" "time" - "github.com/kidoman/embd/controller/servoblaster" - "github.com/kidoman/embd/motion/servo" + "github.com/zlowred/embd/controller/servoblaster" + "github.com/zlowred/embd/motion/servo" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/simpleblinker.go b/samples/simpleblinker.go index 9e4f780..8ef0e5a 100644 --- a/samples/simpleblinker.go +++ b/samples/simpleblinker.go @@ -8,8 +8,8 @@ package main import ( "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/rpi" // This loads the RPi driver + "github.com/zlowred/embd" + _ "github.com/zlowred/embd/host/rpi" // This loads the RPi driver ) func main() { diff --git a/samples/spi.go b/samples/spi.go index 298acc4..8a76c0d 100644 --- a/samples/spi.go +++ b/samples/spi.go @@ -5,8 +5,8 @@ package main import ( "fmt" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/all" + "github.com/zlowred/embd" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/spimcp3008.go b/samples/spimcp3008.go index 394243e..fee3274 100644 --- a/samples/spimcp3008.go +++ b/samples/spimcp3008.go @@ -7,8 +7,8 @@ import ( "fmt" "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/all" + "github.com/zlowred/embd" + _ "github.com/zlowred/embd/host/all" ) const ( diff --git a/samples/tmp006.go b/samples/tmp006.go index 6252b00..2ce5190 100644 --- a/samples/tmp006.go +++ b/samples/tmp006.go @@ -8,10 +8,10 @@ import ( "os" "os/signal" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/tmp006" + "github.com/zlowred/embd" + "github.com/zlowred/embd/sensor/tmp006" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/universalblinker.go b/samples/universalblinker.go index 190ae1d..03f2ccd 100644 --- a/samples/universalblinker.go +++ b/samples/universalblinker.go @@ -10,8 +10,8 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - _ "github.com/kidoman/embd/host/all" + "github.com/zlowred/embd" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/us020.go b/samples/us020.go index f0e7537..7406b7c 100644 --- a/samples/us020.go +++ b/samples/us020.go @@ -9,10 +9,10 @@ import ( "os/signal" "time" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/us020" + "github.com/zlowred/embd" + "github.com/zlowred/embd/sensor/us020" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/samples/watersensor.go b/samples/watersensor.go index ff4ba8a..4890a60 100644 --- a/samples/watersensor.go +++ b/samples/watersensor.go @@ -7,10 +7,10 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" - "github.com/kidoman/embd/sensor/watersensor" + "github.com/zlowred/embd" + "github.com/zlowred/embd/sensor/watersensor" - _ "github.com/kidoman/embd/host/all" + _ "github.com/zlowred/embd/host/all" ) func main() { diff --git a/sensor/bh1750fvi/bh1750fvi.go b/sensor/bh1750fvi/bh1750fvi.go index 6903bb8..f774211 100644 --- a/sensor/bh1750fvi/bh1750fvi.go +++ b/sensor/bh1750fvi/bh1750fvi.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) //accuracy = sensorValue/actualValue] (min = 0.96, typ = 1.2, max = 1.44 diff --git a/sensor/bmp085/bmp085.go b/sensor/bmp085/bmp085.go index b58b37b..c8c184d 100644 --- a/sensor/bmp085/bmp085.go +++ b/sensor/bmp085/bmp085.go @@ -8,7 +8,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/sensor/bmp180/bmp180.go b/sensor/bmp180/bmp180.go index fdc46f3..bcab5b3 100644 --- a/sensor/bmp180/bmp180.go +++ b/sensor/bmp180/bmp180.go @@ -8,7 +8,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/sensor/l3gd20/l3gd20.go b/sensor/l3gd20/l3gd20.go index c3ad94a..c59e2c8 100644 --- a/sensor/l3gd20/l3gd20.go +++ b/sensor/l3gd20/l3gd20.go @@ -8,7 +8,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/sensor/lsm303/lsm303.go b/sensor/lsm303/lsm303.go index 583a0a8..d390045 100644 --- a/sensor/lsm303/lsm303.go +++ b/sensor/lsm303/lsm303.go @@ -7,7 +7,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/sensor/tmp006/tmp006.go b/sensor/tmp006/tmp006.go index 842204b..f6347e9 100644 --- a/sensor/tmp006/tmp006.go +++ b/sensor/tmp006/tmp006.go @@ -9,7 +9,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/sensor/us020/us020.go b/sensor/us020/us020.go index b7d400a..83e581b 100644 --- a/sensor/us020/us020.go +++ b/sensor/us020/us020.go @@ -6,7 +6,7 @@ import ( "time" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) const ( diff --git a/sensor/watersensor/watersensor.go b/sensor/watersensor/watersensor.go index c83628e..7b1dfe5 100644 --- a/sensor/watersensor/watersensor.go +++ b/sensor/watersensor/watersensor.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/golang/glog" - "github.com/kidoman/embd" + "github.com/zlowred/embd" ) // WaterSensor represents a water sensor. From 199e05ae40c764b0074ca9e7774793a2ef99f3c6 Mon Sep 17 00:00:00 2001 From: Max Matveev Date: Sat, 6 Feb 2016 00:31:35 -0800 Subject: [PATCH 05/10] fixed OneWire bus concurrency --- host/rpi/onewirebus.go | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/host/rpi/onewirebus.go b/host/rpi/onewirebus.go index 48e4d0d..3b3e27a 100644 --- a/host/rpi/onewirebus.go +++ b/host/rpi/onewirebus.go @@ -15,7 +15,7 @@ import ( type w1Bus struct { l byte busMap map[string]embd.W1Device - mu sync.Mutex + Mu sync.Mutex initialized bool } @@ -23,9 +23,8 @@ type w1Bus struct { type w1Device struct { file *os.File addr string - mu sync.Mutex - initialized bool + bus w1Bus } func NewW1Bus(l byte) embd.W1Bus { @@ -68,8 +67,8 @@ func (d *w1Device) init() error { } func (d *w1Device) ReadByte() (byte, error) { - d.mu.Lock() - defer d.mu.Unlock() + d.bus.Mu.Lock() + defer d.bus.Mu.Unlock() if err := d.init(); err != nil { return 0, err @@ -86,8 +85,8 @@ func (d *w1Device) ReadByte() (byte, error) { } func (d *w1Device) WriteByte(value byte) error { - d.mu.Lock() - defer d.mu.Unlock() + d.bus.Mu.Lock() + defer d.bus.Mu.Unlock() if err := d.init(); err != nil { return err @@ -103,8 +102,8 @@ func (d *w1Device) WriteByte(value byte) error { } func (d *w1Device) WriteBytes(value []byte) error { - d.mu.Lock() - defer d.mu.Unlock() + d.bus.Mu.Lock() + defer d.bus.Mu.Unlock() if err := d.init(); err != nil { return err @@ -125,8 +124,8 @@ func (d *w1Device) WriteBytes(value []byte) error { } func (d *w1Device) ReadBytes(number int) (value []byte, err error) { - d.mu.Lock() - defer d.mu.Unlock() + d.bus.Mu.Lock() + defer d.bus.Mu.Unlock() if err := d.init(); err != nil { return nil, err @@ -157,21 +156,21 @@ func (b *w1Bus) ListDevices() (devices []string, err error) { } func (b *w1Bus) Open(address string) (device embd.W1Device, err error) { - b.mu.Lock() - defer b.mu.Unlock() + b.Mu.Lock() + defer b.Mu.Unlock() if d, ok := b.busMap[address]; ok { return d, nil } - d := &w1Device{addr: address} + d := &w1Device{addr: address, bus: b} b.busMap[address] = d return d, nil } func (b *w1Bus) Close() error { - b.mu.Lock() - defer b.mu.Unlock() + b.Mu.Lock() + defer b.Mu.Unlock() for _, b := range b.busMap { b.Close() @@ -180,13 +179,13 @@ func (b *w1Bus) Close() error { return nil } -func (b *w1Device) Close() error { - b.mu.Lock() - defer b.mu.Unlock() +func (d *w1Device) Close() error { + d.bus.Mu.Lock() + defer d.bus.Mu.Unlock() - if !b.initialized { + if !d.initialized { return nil } - return b.file.Close() + return d.file.Close() } From d8c3f57dc1b8ffa13cf4247b403516c1c37521ae Mon Sep 17 00:00:00 2001 From: Max Matveev Date: Sat, 6 Feb 2016 00:48:54 -0800 Subject: [PATCH 06/10] fixed OneWire bus concurrency & sample --- host/rpi/onewirebus.go | 2 +- samples/onewire.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/host/rpi/onewirebus.go b/host/rpi/onewirebus.go index 3b3e27a..eff7429 100644 --- a/host/rpi/onewirebus.go +++ b/host/rpi/onewirebus.go @@ -24,7 +24,7 @@ type w1Device struct { file *os.File addr string initialized bool - bus w1Bus + bus *w1Bus } func NewW1Bus(l byte) embd.W1Bus { diff --git a/samples/onewire.go b/samples/onewire.go index e213bb3..f7e272f 100644 --- a/samples/onewire.go +++ b/samples/onewire.go @@ -24,7 +24,7 @@ func main() { } for _, dev := range devs { - fmt.Println("OneWire device: %s", dev) + fmt.Printf("OneWire device: %s\n", dev) } w1d, err := w1.Open("28-011572120bff") From 4a75b30fccd745a4abdd72e0326a30a1d7c744ab Mon Sep 17 00:00:00 2001 From: Max Matveev Date: Sat, 6 Feb 2016 00:51:02 -0800 Subject: [PATCH 07/10] import point to original repo --- CONTRIBUTING.md | 2 +- README.md | 86 ++++++++++++------------- controller/hd44780/hd44780.go | 2 +- controller/hd44780/hd44780_test.go | 2 +- controller/mcp4725/mcp4725.go | 2 +- controller/pca9685/pca9685.go | 4 +- convertors/mcp3008/mcp3008.go | 2 +- detect.go | 2 +- doc.go | 18 +++--- embd/detect.go | 2 +- embd/main.go | 2 +- host/all/all.go | 4 +- host/bbb/analogpin.go | 2 +- host/bbb/analogpin_test.go | 2 +- host/bbb/bbb.go | 4 +- host/bbb/pwmpin.go | 4 +- host/bbb/pwmpin_test.go | 2 +- host/generic/digitalpin.go | 2 +- host/generic/digitalpin_test.go | 2 +- host/generic/i2cbus.go | 2 +- host/generic/interrupt.go | 2 +- host/generic/led.go | 2 +- host/generic/spibus.go | 2 +- host/rpi/onewirebus.go | 2 +- host/rpi/rpi.go | 4 +- interface/keypad/matrix4x3/matrix4x3.go | 2 +- motion/servo/servo.go | 2 +- samples/28bjy-48.go | 4 +- samples/analog.go | 4 +- samples/analogshort.go | 4 +- samples/bh1750fvi.go | 6 +- samples/bmp085.go | 6 +- samples/bmp180.go | 6 +- samples/characterdisplay.go | 8 +-- samples/fullblinker.go | 4 +- samples/gpio.go | 4 +- samples/gpiodetect.go | 4 +- samples/gpiodirect.go | 4 +- samples/gpiointerrupt.go | 4 +- samples/gpioshort.go | 4 +- samples/hd44780.go | 6 +- samples/keypad/matrix4x3.go | 4 +- samples/l3gd20.go | 6 +- samples/led.go | 4 +- samples/ledshort.go | 4 +- samples/lsm303.go | 6 +- samples/mcp3008.go | 6 +- samples/mcp4725.go | 6 +- samples/onewire.go | 4 +- samples/pca9685.go | 6 +- samples/pwm.go | 6 +- samples/servo.go | 8 +-- samples/servobbb.go | 6 +- samples/servoblaster.go | 6 +- samples/simpleblinker.go | 4 +- samples/spi.go | 4 +- samples/spimcp3008.go | 4 +- samples/tmp006.go | 6 +- samples/universalblinker.go | 4 +- samples/us020.go | 6 +- samples/watersensor.go | 6 +- sensor/bh1750fvi/bh1750fvi.go | 2 +- sensor/bmp085/bmp085.go | 2 +- sensor/bmp180/bmp180.go | 2 +- sensor/l3gd20/l3gd20.go | 2 +- sensor/lsm303/lsm303.go | 2 +- sensor/tmp006/tmp006.go | 2 +- sensor/us020/us020.go | 2 +- sensor/watersensor/watersensor.go | 2 +- 69 files changed, 177 insertions(+), 177 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b26f838..975aca7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ This actually is really simple. A few simple guidelines and we can break for dinner: * EMBD is designed with a lot of affection, with utmost importance given to the dev experience (read: the API feel and style.) So always think from that angle when creating the pull request -* [Documentation](https://godoc.org/github.com/zlowred/embd) helps drive adoption. No exceptions +* [Documentation](https://godoc.org/github.com/kidoman/embd) helps drive adoption. No exceptions When it comes to the code: diff --git a/README.md b/README.md index 0d8ba31..f37b5b5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# embd [![Build Status](https://travis-ci.org/kidoman/embd.svg?branch=master)](https://travis-ci.org/kidoman/embd) [![GoDoc](http://godoc.org/github.com/zlowred/embd?status.png)](http://godoc.org/github.com/zlowred/embd) +# embd [![Build Status](https://travis-ci.org/kidoman/embd.svg?branch=master)](https://travis-ci.org/kidoman/embd) [![GoDoc](http://godoc.org/github.com/kidoman/embd?status.png)](http://godoc.org/github.com/kidoman/embd) **embd** is a hardware abstraction layer (HAL) for embedded systems. @@ -6,7 +6,7 @@ It allows you to start your hardware hack on easily available hobby boards (like Development supported and sponsored by [**SoStronk**](https://www.sostronk.com) and [**ThoughtWorks**](http://www.thoughtworks.com/) -Also, you might be interested in: [Why Golang?](https://github.com/zlowred/embd/wiki/Why-Go) +Also, you might be interested in: [Why Golang?](https://github.com/kidoman/embd/wiki/Why-Go) [Blog post introducing EMBD](http://kidoman.io/framework/embd.html) @@ -20,8 +20,8 @@ package main import ( "time" - "github.com/zlowred/embd" - _ "github.com/zlowred/embd/host/rpi" // This loads the RPi driver + "github.com/kidoman/embd" + _ "github.com/kidoman/embd/host/rpi" // This loads the RPi driver ) func main() { @@ -34,7 +34,7 @@ func main() { Then install the EMBD package (go1.2 and greater is required): - $ go get github.com/zlowred/embd + $ go get github.com/kidoman/embd Build the binary*: @@ -58,7 +58,7 @@ Then run the program with ```sudo```*: * We are instructing the ```go``` compiler to create a binary which will run on the RaspberryPi processor * Assuming your RaspberryPi has an IP address of ```192.168.2.2```. Substitute as necessary * ```sudo``` (root) permission is required as we are controlling the hardware by writing to special files -* This sample program is optimized for brevity and does not clean up after itself. Click here to see the [full version](https://github.com/zlowred/embd/blob/master/samples/fullblinker.go) +* This sample program is optimized for brevity and does not clean up after itself. Click here to see the [full version](https://github.com/kidoman/embd/blob/master/samples/fullblinker.go) ## Getting Help @@ -76,7 +76,7 @@ Join the [mailing list](https://groups.google.com/forum/#!forum/go-embd) ## The command line tool - go get github.com/zlowred/embd/embd + go get github.com/kidoman/embd/embd will install a command line utility ```embd``` which will allow you to quickly get started with prototyping. The binary should be available in your ```$GOPATH/bin```. However, to be able to run this on a ARM based device, you will need to build it with ```GOOS=linux``` and ```GOARCH=arm``` environment variables set. @@ -96,14 +96,14 @@ Package **embd** provides a hardware abstraction layer for doing embedded progra on supported platforms like the Raspberry Pi and BeagleBone Black. Most of the examples below will work without change (i.e. the same binary) on all supported platforms. How cool is that? -Although samples are all present in the [samples](https://github.com/zlowred/embd/tree/master/samples) folder, +Although samples are all present in the [samples](https://github.com/kidoman/embd/tree/master/samples) folder, we will show a few choice examples here. Use the **LED** driver to toggle LEDs on the BBB: ```go -import "github.com/zlowred/embd" -import _ "github.com/zlowred/embd/host/all" +import "github.com/kidoman/embd" +import _ "github.com/kidoman/embd/host/all" ... embd.InitLED() defer embd.CloseLED() @@ -116,8 +116,8 @@ led.Toggle() Even shorter when quickly trying things out: ```go -import "github.com/zlowred/embd" -import _ "github.com/zlowred/embd/host/all" +import "github.com/kidoman/embd" +import _ "github.com/kidoman/embd/host/all" ... embd.InitLED() defer embd.CloseLED() @@ -130,8 +130,8 @@ embd.ToggleLED(3) BBB + **PWM**: ```go -import "github.com/zlowred/embd" -import _ "github.com/zlowred/embd/host/all" +import "github.com/kidoman/embd" +import _ "github.com/kidoman/embd/host/all" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -145,8 +145,8 @@ pwm.SetDuty(1000) Control **GPIO** pins on the RaspberryPi / BeagleBone Black: ```go -import "github.com/zlowred/embd" -import _ "github.com/zlowred/embd/host/all" +import "github.com/kidoman/embd" +import _ "github.com/kidoman/embd/host/all" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -158,8 +158,8 @@ embd.DigitalWrite(10, embd.High) Could also do: ```go -import "github.com/zlowred/embd" -import _ "github.com/zlowred/embd/host/all" +import "github.com/kidoman/embd" +import _ "github.com/kidoman/embd/host/all" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -173,9 +173,9 @@ pin.Write(embd.High) Or read data from the **Bosch BMP085** barometric sensor: ```go -import "github.com/zlowred/embd" -import "github.com/zlowred/embd/sensor/bmp085" -import _ "github.com/zlowred/embd/host/all" +import "github.com/kidoman/embd" +import "github.com/kidoman/embd/sensor/bmp085" +import _ "github.com/kidoman/embd/host/all" ... bus := embd.NewI2CBus(1) ... @@ -188,9 +188,9 @@ altitude, err := baro.Altitude() Even find out the heading from the **LSM303** magnetometer: ```go -import "github.com/zlowred/embd" -import "github.com/zlowred/embd/sensor/lsm303" -import _ "github.com/zlowred/embd/host/all" +import "github.com/kidoman/embd" +import "github.com/kidoman/embd/sensor/lsm303" +import _ "github.com/kidoman/embd/host/all" ... bus := embd.NewI2CBus(1) ... @@ -204,28 +204,28 @@ platforms. ## Protocols Supported -* **Digital GPIO** [Documentation](http://godoc.org/github.com/zlowred/embd#DigitalPin) -* **Analog GPIO** [Documentation](http://godoc.org/github.com/zlowred/embd#AnalogPin) -* **PWM** [Documentation](http://godoc.org/github.com/zlowred/embd#PWMPin) -* **I2C** [Documentation](http://godoc.org/github.com/zlowred/embd#I2CBus) -* **LED** [Documentation](http://godoc.org/github.com/zlowred/embd#LED) -* **SPI** [Documentation](http://godoc.org/github.com/zlowred/embd#SPIBus) +* **Digital GPIO** [Documentation](http://godoc.org/github.com/kidoman/embd#DigitalPin) +* **Analog GPIO** [Documentation](http://godoc.org/github.com/kidoman/embd#AnalogPin) +* **PWM** [Documentation](http://godoc.org/github.com/kidoman/embd#PWMPin) +* **I2C** [Documentation](http://godoc.org/github.com/kidoman/embd#I2CBus) +* **LED** [Documentation](http://godoc.org/github.com/kidoman/embd#LED) +* **SPI** [Documentation](http://godoc.org/github.com/kidoman/embd#SPIBus) ## Sensors Supported -* **TMP006** Thermopile sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/tmp006), [Datasheet](http://www.adafruit.com/datasheets/tmp006.pdf), [Userguide](http://www.adafruit.com/datasheets/tmp006ug.pdf) +* **TMP006** Thermopile sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/tmp006), [Datasheet](http://www.adafruit.com/datasheets/tmp006.pdf), [Userguide](http://www.adafruit.com/datasheets/tmp006ug.pdf) -* **BMP085** Barometric pressure sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/bmp085), [Datasheet](https://www.sparkfun.com/datasheets/Components/General/BST-BMP085-DS000-05.pdf) +* **BMP085** Barometric pressure sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/bmp085), [Datasheet](https://www.sparkfun.com/datasheets/Components/General/BST-BMP085-DS000-05.pdf) -* **BMP180** Barometric pressure sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/bmp180), [Datasheet](http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf) +* **BMP180** Barometric pressure sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/bmp180), [Datasheet](http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf) -* **LSM303** Accelerometer and magnetometer [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/lsm303), [Datasheet](https://www.sparkfun.com/datasheets/Sensors/Magneto/LSM303%20Datasheet.pdf) +* **LSM303** Accelerometer and magnetometer [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/lsm303), [Datasheet](https://www.sparkfun.com/datasheets/Sensors/Magneto/LSM303%20Datasheet.pdf) -* **L3GD20** Gyroscope [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/l3gd20), [Datasheet](http://www.adafruit.com/datasheets/L3GD20.pdf) +* **L3GD20** Gyroscope [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/l3gd20), [Datasheet](http://www.adafruit.com/datasheets/L3GD20.pdf) -* **US020** Ultrasonic proximity sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/us020), [Product Page](http://www.digibay.in/sensor/object-detection-and-proximity?product_id=239) +* **US020** Ultrasonic proximity sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/us020), [Product Page](http://www.digibay.in/sensor/object-detection-and-proximity?product_id=239) -* **BH1750FVI** Luminosity sensor [Documentation](http://godoc.org/github.com/zlowred/embd/sensor/bh1750fvi), [Datasheet](http://www.elechouse.com/elechouse/images/product/Digital%20light%20Sensor/bh1750fvi-e.pdf) +* **BH1750FVI** Luminosity sensor [Documentation](http://godoc.org/github.com/kidoman/embd/sensor/bh1750fvi), [Datasheet](http://www.elechouse.com/elechouse/images/product/Digital%20light%20Sensor/bh1750fvi-e.pdf) ## Interfaces @@ -233,11 +233,11 @@ platforms. ## Controllers -* **PCA9685** 16-channel, 12-bit PWM Controller with I2C protocol [Documentation](http://godoc.org/github.com/zlowred/embd/controller/pca9685), [Datasheet](http://www.adafruit.com/datasheets/PCA9685.pdf), [Product Page](http://www.adafruit.com/products/815) +* **PCA9685** 16-channel, 12-bit PWM Controller with I2C protocol [Documentation](http://godoc.org/github.com/kidoman/embd/controller/pca9685), [Datasheet](http://www.adafruit.com/datasheets/PCA9685.pdf), [Product Page](http://www.adafruit.com/products/815) -* **MCP4725** 12-bit DAC [Documentation](http://godoc.org/github.com/zlowred/embd/controller/mcp4725), [Datasheet](http://www.adafruit.com/datasheets/mcp4725.pdf), [Product Page](http://www.adafruit.com/products/935) +* **MCP4725** 12-bit DAC [Documentation](http://godoc.org/github.com/kidoman/embd/controller/mcp4725), [Datasheet](http://www.adafruit.com/datasheets/mcp4725.pdf), [Product Page](http://www.adafruit.com/products/935) -* **ServoBlaster** RPi PWM/PCM based PWM controller [Documentation](http://godoc.org/github.com/zlowred/embd/controller/servoblaster), [Product Page](https://github.com/richardghirst/PiBits/tree/master/ServoBlaster) +* **ServoBlaster** RPi PWM/PCM based PWM controller [Documentation](http://godoc.org/github.com/kidoman/embd/controller/servoblaster), [Product Page](https://github.com/richardghirst/PiBits/tree/master/ServoBlaster) ## Convertors @@ -245,10 +245,10 @@ platforms. ## Contributing -We look forward to your pull requests, but contributions which abide by the [guidelines](https://github.com/zlowred/embd/blob/master/CONTRIBUTING.md) will get a free beer! +We look forward to your pull requests, but contributions which abide by the [guidelines](https://github.com/kidoman/embd/blob/master/CONTRIBUTING.md) will get a free beer! -File an [issue](https://github.com/zlowred/embd/issues), open a [pull request](https://github.com/zlowred/embd/pulls). We are waiting. +File an [issue](https://github.com/kidoman/embd/issues), open a [pull request](https://github.com/kidoman/embd/pulls). We are waiting. ## About -EMBD is affectionately designed/developed by Karan Misra ([kidoman](https://github.com/kidoman)), Kunal Powar ([kunalpowar](https://github.com/kunalpowar)) and [FRIENDS](https://github.com/zlowred/embd/blob/master/AUTHORS). We also have a list of [CONTRIBUTORS](https://github.com/zlowred/embd/blob/master/CONTRIBUTORS). +EMBD is affectionately designed/developed by Karan Misra ([kidoman](https://github.com/kidoman)), Kunal Powar ([kunalpowar](https://github.com/kunalpowar)) and [FRIENDS](https://github.com/kidoman/embd/blob/master/AUTHORS). We also have a list of [CONTRIBUTORS](https://github.com/kidoman/embd/blob/master/CONTRIBUTORS). diff --git a/controller/hd44780/hd44780.go b/controller/hd44780/hd44780.go index 5e12430..88032d5 100644 --- a/controller/hd44780/hd44780.go +++ b/controller/hd44780/hd44780.go @@ -16,7 +16,7 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) type entryMode byte diff --git a/controller/hd44780/hd44780_test.go b/controller/hd44780/hd44780_test.go index 34ef629..b05dddc 100644 --- a/controller/hd44780/hd44780_test.go +++ b/controller/hd44780/hd44780_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/controller/mcp4725/mcp4725.go b/controller/mcp4725/mcp4725.go index 8727a54..1dcaa91 100644 --- a/controller/mcp4725/mcp4725.go +++ b/controller/mcp4725/mcp4725.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/controller/pca9685/pca9685.go b/controller/pca9685/pca9685.go index 20a2966..9a9407d 100644 --- a/controller/pca9685/pca9685.go +++ b/controller/pca9685/pca9685.go @@ -7,8 +7,8 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" - "github.com/zlowred/embd/util" + "github.com/kidoman/embd" + "github.com/kidoman/embd/util" ) const ( diff --git a/convertors/mcp3008/mcp3008.go b/convertors/mcp3008/mcp3008.go index d363fe7..e5ecb99 100644 --- a/convertors/mcp3008/mcp3008.go +++ b/convertors/mcp3008/mcp3008.go @@ -3,7 +3,7 @@ package mcp3008 import ( "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) // MCP3008 represents a mcp3008 8bit DAC. diff --git a/detect.go b/detect.go index 3eb6f1d..a92ff4e 100644 --- a/detect.go +++ b/detect.go @@ -122,6 +122,6 @@ func DetectHost() (host Host, rev int, err error) { case strings.Contains(hardware, "BCM2708") || strings.Contains(hardware, "BCM2709"): return HostRPi, rev, nil default: - return HostNull, 0, fmt.Errorf(`embd: your host "%v:%v" is not supported at this moment. request support at https://github.com/zlowred/embd/issues`, host, model) + return HostNull, 0, fmt.Errorf(`embd: your host "%v:%v" is not supported at this moment. request support at https://github.com/kidoman/embd/issues`, host, model) } } diff --git a/doc.go b/doc.go index 0b05449..80118d4 100644 --- a/doc.go +++ b/doc.go @@ -7,7 +7,7 @@ Use the LED driver to toggle LEDs on the BBB: - import "github.com/zlowred/embd" + import "github.com/kidoman/embd" ... embd.InitLED() defer embd.CloseLED() @@ -18,7 +18,7 @@ Even shorter while prototyping: - import "github.com/zlowred/embd" + import "github.com/kidoman/embd" ... embd.InitLED() defer embd.CloseLED() @@ -27,7 +27,7 @@ BBB + PWM: - import "github.com/zlowred/embd" + import "github.com/kidoman/embd" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -39,7 +39,7 @@ Control GPIO pins on the RaspberryPi / BeagleBone Black: - import "github.com/zlowred/embd" + import "github.com/kidoman/embd" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -49,7 +49,7 @@ Could also do: - import "github.com/zlowred/embd" + import "github.com/kidoman/embd" ... embd.InitGPIO() defer embd.CloseGPIO() @@ -61,8 +61,8 @@ Or read data from the Bosch BMP085 barometric sensor: - import "github.com/zlowred/embd" - import "github.com/zlowred/embd/sensor/bmp085" + import "github.com/kidoman/embd" + import "github.com/kidoman/embd/sensor/bmp085" ... bus := embd.NewI2CBus(1) ... @@ -73,8 +73,8 @@ Even find out the heading from the LSM303 magnetometer: - import "github.com/zlowred/embd" - import "github.com/zlowred/embd/sensor/lsm303" + import "github.com/kidoman/embd" + import "github.com/kidoman/embd/sensor/lsm303" ... bus := embd.NewI2CBus(1) ... diff --git a/embd/detect.go b/embd/detect.go index 671543f..6659980 100644 --- a/embd/detect.go +++ b/embd/detect.go @@ -5,7 +5,7 @@ import ( "os" "github.com/codegangsta/cli" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) func detect(c *cli.Context) { diff --git a/embd/main.go b/embd/main.go index 67082e6..7ea7424 100644 --- a/embd/main.go +++ b/embd/main.go @@ -4,7 +4,7 @@ import ( "os" "github.com/codegangsta/cli" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) var version = "0.1.0" diff --git a/host/all/all.go b/host/all/all.go index e29411c..5bfd7a9 100644 --- a/host/all/all.go +++ b/host/all/all.go @@ -2,6 +2,6 @@ package all import ( - _ "github.com/zlowred/embd/host/bbb" - _ "github.com/zlowred/embd/host/rpi" + _ "github.com/kidoman/embd/host/bbb" + _ "github.com/kidoman/embd/host/rpi" ) diff --git a/host/bbb/analogpin.go b/host/bbb/analogpin.go index 2326601..e12b9dd 100644 --- a/host/bbb/analogpin.go +++ b/host/bbb/analogpin.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) type analogPin struct { diff --git a/host/bbb/analogpin_test.go b/host/bbb/analogpin_test.go index 702e41d..49f22cb 100644 --- a/host/bbb/analogpin_test.go +++ b/host/bbb/analogpin_test.go @@ -3,7 +3,7 @@ package bbb import ( "testing" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) func TestAnalogPinClose(t *testing.T) { diff --git a/host/bbb/bbb.go b/host/bbb/bbb.go index c9ccf27..f909627 100644 --- a/host/bbb/bbb.go +++ b/host/bbb/bbb.go @@ -16,8 +16,8 @@ import ( "strings" "github.com/golang/glog" - "github.com/zlowred/embd" - "github.com/zlowred/embd/host/generic" + "github.com/kidoman/embd" + "github.com/kidoman/embd/host/generic" ) var pins = embd.PinMap{ diff --git a/host/bbb/pwmpin.go b/host/bbb/pwmpin.go index 73cc81b..1bd6c95 100644 --- a/host/bbb/pwmpin.go +++ b/host/bbb/pwmpin.go @@ -11,8 +11,8 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" - "github.com/zlowred/embd/util" + "github.com/kidoman/embd" + "github.com/kidoman/embd/util" ) const ( diff --git a/host/bbb/pwmpin_test.go b/host/bbb/pwmpin_test.go index fd27b9c..1c07ff3 100644 --- a/host/bbb/pwmpin_test.go +++ b/host/bbb/pwmpin_test.go @@ -3,7 +3,7 @@ package bbb import ( "testing" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) func TestPWMPinClose(t *testing.T) { diff --git a/host/generic/digitalpin.go b/host/generic/digitalpin.go index 2dbb252..80a81ea 100644 --- a/host/generic/digitalpin.go +++ b/host/generic/digitalpin.go @@ -12,7 +12,7 @@ import ( "strconv" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) type digitalPin struct { diff --git a/host/generic/digitalpin_test.go b/host/generic/digitalpin_test.go index df5c99e..18e900e 100644 --- a/host/generic/digitalpin_test.go +++ b/host/generic/digitalpin_test.go @@ -3,7 +3,7 @@ package generic import ( "testing" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) func TestDigitalPinClose(t *testing.T) { diff --git a/host/generic/i2cbus.go b/host/generic/i2cbus.go index 1cb10d4..dc8e74c 100644 --- a/host/generic/i2cbus.go +++ b/host/generic/i2cbus.go @@ -12,7 +12,7 @@ import ( "unsafe" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/host/generic/interrupt.go b/host/generic/interrupt.go index 3eba081..4052283 100644 --- a/host/generic/interrupt.go +++ b/host/generic/interrupt.go @@ -8,7 +8,7 @@ import ( "sync" "syscall" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/host/generic/led.go b/host/generic/led.go index 21826bc..67f56c9 100644 --- a/host/generic/led.go +++ b/host/generic/led.go @@ -8,7 +8,7 @@ import ( "os" "strings" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) type led struct { diff --git a/host/generic/spibus.go b/host/generic/spibus.go index 99755ab..ad3bcec 100644 --- a/host/generic/spibus.go +++ b/host/generic/spibus.go @@ -8,7 +8,7 @@ import ( "unsafe" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/host/rpi/onewirebus.go b/host/rpi/onewirebus.go index eff7429..6c76e8b 100644 --- a/host/rpi/onewirebus.go +++ b/host/rpi/onewirebus.go @@ -8,7 +8,7 @@ import ( "sync" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" "io/ioutil" ) diff --git a/host/rpi/rpi.go b/host/rpi/rpi.go index cd424a5..aae14b2 100644 --- a/host/rpi/rpi.go +++ b/host/rpi/rpi.go @@ -11,8 +11,8 @@ package rpi import ( - "github.com/zlowred/embd" - "github.com/zlowred/embd/host/generic" + "github.com/kidoman/embd" + "github.com/kidoman/embd/host/generic" ) var spiDeviceMinor = byte(0) diff --git a/interface/keypad/matrix4x3/matrix4x3.go b/interface/keypad/matrix4x3/matrix4x3.go index cb268b4..6ef984f 100644 --- a/interface/keypad/matrix4x3/matrix4x3.go +++ b/interface/keypad/matrix4x3/matrix4x3.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) type Key int diff --git a/motion/servo/servo.go b/motion/servo/servo.go index 5bb51f9..c0876d2 100644 --- a/motion/servo/servo.go +++ b/motion/servo/servo.go @@ -3,7 +3,7 @@ package servo import ( "github.com/golang/glog" - "github.com/zlowred/embd/util" + "github.com/kidoman/embd/util" ) const ( diff --git a/samples/28bjy-48.go b/samples/28bjy-48.go index f49be5f..456b7db 100644 --- a/samples/28bjy-48.go +++ b/samples/28bjy-48.go @@ -18,8 +18,8 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" - _ "github.com/zlowred/embd/host/rpi" + "github.com/kidoman/embd" + _ "github.com/kidoman/embd/host/rpi" ) func main() { diff --git a/samples/analog.go b/samples/analog.go index b935e2a..687ecd5 100644 --- a/samples/analog.go +++ b/samples/analog.go @@ -9,9 +9,9 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/analogshort.go b/samples/analogshort.go index 501224a..064be32 100644 --- a/samples/analogshort.go +++ b/samples/analogshort.go @@ -6,9 +6,9 @@ import ( "flag" "fmt" - "github.com/zlowred/embd" + "github.com/kidoman/embd" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/bh1750fvi.go b/samples/bh1750fvi.go index 1b7139a..83e9a72 100644 --- a/samples/bh1750fvi.go +++ b/samples/bh1750fvi.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/sensor/bh1750fvi" + "github.com/kidoman/embd" + "github.com/kidoman/embd/sensor/bh1750fvi" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/bmp085.go b/samples/bmp085.go index 7860a39..0fa56ad 100644 --- a/samples/bmp085.go +++ b/samples/bmp085.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/sensor/bmp085" + "github.com/kidoman/embd" + "github.com/kidoman/embd/sensor/bmp085" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/bmp180.go b/samples/bmp180.go index f39ae2b..845e771 100644 --- a/samples/bmp180.go +++ b/samples/bmp180.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/sensor/bmp180" + "github.com/kidoman/embd" + "github.com/kidoman/embd/sensor/bmp180" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/characterdisplay.go b/samples/characterdisplay.go index 5b14410..7a054aa 100644 --- a/samples/characterdisplay.go +++ b/samples/characterdisplay.go @@ -6,11 +6,11 @@ import ( "flag" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/controller/hd44780" - "github.com/zlowred/embd/interface/display/characterdisplay" + "github.com/kidoman/embd" + "github.com/kidoman/embd/controller/hd44780" + "github.com/kidoman/embd/interface/display/characterdisplay" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/fullblinker.go b/samples/fullblinker.go index 2e07e39..7e43b36 100644 --- a/samples/fullblinker.go +++ b/samples/fullblinker.go @@ -11,8 +11,8 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" - _ "github.com/zlowred/embd/host/rpi" + "github.com/kidoman/embd" + _ "github.com/kidoman/embd/host/rpi" ) func main() { diff --git a/samples/gpio.go b/samples/gpio.go index ab5c1fa..b3769eb 100644 --- a/samples/gpio.go +++ b/samples/gpio.go @@ -6,9 +6,9 @@ import ( "flag" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/gpiodetect.go b/samples/gpiodetect.go index f709667..8bc5f78 100644 --- a/samples/gpiodetect.go +++ b/samples/gpiodetect.go @@ -6,9 +6,9 @@ import ( "flag" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/gpiodirect.go b/samples/gpiodirect.go index d4d3002..85bd22c 100644 --- a/samples/gpiodirect.go +++ b/samples/gpiodirect.go @@ -6,9 +6,9 @@ import ( "flag" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/gpiointerrupt.go b/samples/gpiointerrupt.go index ebf4386..9b6ccc9 100644 --- a/samples/gpiointerrupt.go +++ b/samples/gpiointerrupt.go @@ -6,9 +6,9 @@ import ( "flag" "fmt" - "github.com/zlowred/embd" + "github.com/kidoman/embd" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/gpioshort.go b/samples/gpioshort.go index a05c449..b1c5c2c 100644 --- a/samples/gpioshort.go +++ b/samples/gpioshort.go @@ -5,9 +5,9 @@ package main import ( "flag" - "github.com/zlowred/embd" + "github.com/kidoman/embd" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/hd44780.go b/samples/hd44780.go index aecd01d..418fa7e 100644 --- a/samples/hd44780.go +++ b/samples/hd44780.go @@ -6,10 +6,10 @@ import ( "flag" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/controller/hd44780" + "github.com/kidoman/embd" + "github.com/kidoman/embd/controller/hd44780" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/keypad/matrix4x3.go b/samples/keypad/matrix4x3.go index 9d54dea..9b4feda 100644 --- a/samples/keypad/matrix4x3.go +++ b/samples/keypad/matrix4x3.go @@ -5,8 +5,8 @@ package main import ( "fmt" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/interface/keypad/matrix4x3" + "github.com/kidoman/embd" + "github.com/kidoman/embd/interface/keypad/matrix4x3" ) func main() { diff --git a/samples/l3gd20.go b/samples/l3gd20.go index 2710d39..f0a94e6 100644 --- a/samples/l3gd20.go +++ b/samples/l3gd20.go @@ -9,10 +9,10 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/sensor/l3gd20" + "github.com/kidoman/embd" + "github.com/kidoman/embd/sensor/l3gd20" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/led.go b/samples/led.go index 6cacd1e..82650d0 100644 --- a/samples/led.go +++ b/samples/led.go @@ -11,9 +11,9 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" - _ "github.com/zlowred/embd/host/bbb" + _ "github.com/kidoman/embd/host/bbb" ) func main() { diff --git a/samples/ledshort.go b/samples/ledshort.go index 8cd2c2c..64a01ce 100644 --- a/samples/ledshort.go +++ b/samples/ledshort.go @@ -8,9 +8,9 @@ import ( "flag" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" - _ "github.com/zlowred/embd/host/bbb" + _ "github.com/kidoman/embd/host/bbb" ) func main() { diff --git a/samples/lsm303.go b/samples/lsm303.go index d08b11b..e4461de 100644 --- a/samples/lsm303.go +++ b/samples/lsm303.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/sensor/lsm303" + "github.com/kidoman/embd" + "github.com/kidoman/embd/sensor/lsm303" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/mcp3008.go b/samples/mcp3008.go index eedf3be..791d56a 100644 --- a/samples/mcp3008.go +++ b/samples/mcp3008.go @@ -8,9 +8,9 @@ import ( "fmt" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/convertors/mcp3008" - _ "github.com/zlowred/embd/host/all" + "github.com/kidoman/embd" + "github.com/kidoman/embd/convertors/mcp3008" + _ "github.com/kidoman/embd/host/all" ) const ( diff --git a/samples/mcp4725.go b/samples/mcp4725.go index 7dbc8f7..ad80967 100644 --- a/samples/mcp4725.go +++ b/samples/mcp4725.go @@ -9,10 +9,10 @@ import ( "os" "os/signal" - "github.com/zlowred/embd" - "github.com/zlowred/embd/controller/mcp4725" + "github.com/kidoman/embd" + "github.com/kidoman/embd/controller/mcp4725" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/onewire.go b/samples/onewire.go index f7e272f..f6a62b6 100644 --- a/samples/onewire.go +++ b/samples/onewire.go @@ -5,8 +5,8 @@ package main import ( "fmt" - "github.com/zlowred/embd" - _ "github.com/zlowred/embd/host/all" + "github.com/kidoman/embd" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/pca9685.go b/samples/pca9685.go index aca5db3..9976340 100644 --- a/samples/pca9685.go +++ b/samples/pca9685.go @@ -8,10 +8,10 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/controller/pca9685" + "github.com/kidoman/embd" + "github.com/kidoman/embd/controller/pca9685" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/pwm.go b/samples/pwm.go index 86f62f3..cecbc4d 100644 --- a/samples/pwm.go +++ b/samples/pwm.go @@ -8,10 +8,10 @@ import ( "flag" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/host/bbb" + "github.com/kidoman/embd" + "github.com/kidoman/embd/host/bbb" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/servo.go b/samples/servo.go index a451d97..2e82dd8 100644 --- a/samples/servo.go +++ b/samples/servo.go @@ -8,11 +8,11 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/controller/pca9685" - "github.com/zlowred/embd/motion/servo" + "github.com/kidoman/embd" + "github.com/kidoman/embd/controller/pca9685" + "github.com/kidoman/embd/motion/servo" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/servobbb.go b/samples/servobbb.go index ba4ecdd..fbf0db1 100644 --- a/samples/servobbb.go +++ b/samples/servobbb.go @@ -8,10 +8,10 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/motion/servo" + "github.com/kidoman/embd" + "github.com/kidoman/embd/motion/servo" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/servoblaster.go b/samples/servoblaster.go index 777c673..b2d4cdf 100644 --- a/samples/servoblaster.go +++ b/samples/servoblaster.go @@ -8,10 +8,10 @@ import ( "os/signal" "time" - "github.com/zlowred/embd/controller/servoblaster" - "github.com/zlowred/embd/motion/servo" + "github.com/kidoman/embd/controller/servoblaster" + "github.com/kidoman/embd/motion/servo" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/simpleblinker.go b/samples/simpleblinker.go index 8ef0e5a..9e4f780 100644 --- a/samples/simpleblinker.go +++ b/samples/simpleblinker.go @@ -8,8 +8,8 @@ package main import ( "time" - "github.com/zlowred/embd" - _ "github.com/zlowred/embd/host/rpi" // This loads the RPi driver + "github.com/kidoman/embd" + _ "github.com/kidoman/embd/host/rpi" // This loads the RPi driver ) func main() { diff --git a/samples/spi.go b/samples/spi.go index 8a76c0d..298acc4 100644 --- a/samples/spi.go +++ b/samples/spi.go @@ -5,8 +5,8 @@ package main import ( "fmt" - "github.com/zlowred/embd" - _ "github.com/zlowred/embd/host/all" + "github.com/kidoman/embd" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/spimcp3008.go b/samples/spimcp3008.go index fee3274..394243e 100644 --- a/samples/spimcp3008.go +++ b/samples/spimcp3008.go @@ -7,8 +7,8 @@ import ( "fmt" "time" - "github.com/zlowred/embd" - _ "github.com/zlowred/embd/host/all" + "github.com/kidoman/embd" + _ "github.com/kidoman/embd/host/all" ) const ( diff --git a/samples/tmp006.go b/samples/tmp006.go index 2ce5190..6252b00 100644 --- a/samples/tmp006.go +++ b/samples/tmp006.go @@ -8,10 +8,10 @@ import ( "os" "os/signal" - "github.com/zlowred/embd" - "github.com/zlowred/embd/sensor/tmp006" + "github.com/kidoman/embd" + "github.com/kidoman/embd/sensor/tmp006" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/universalblinker.go b/samples/universalblinker.go index 03f2ccd..190ae1d 100644 --- a/samples/universalblinker.go +++ b/samples/universalblinker.go @@ -10,8 +10,8 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" - _ "github.com/zlowred/embd/host/all" + "github.com/kidoman/embd" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/us020.go b/samples/us020.go index 7406b7c..f0e7537 100644 --- a/samples/us020.go +++ b/samples/us020.go @@ -9,10 +9,10 @@ import ( "os/signal" "time" - "github.com/zlowred/embd" - "github.com/zlowred/embd/sensor/us020" + "github.com/kidoman/embd" + "github.com/kidoman/embd/sensor/us020" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/samples/watersensor.go b/samples/watersensor.go index 4890a60..ff4ba8a 100644 --- a/samples/watersensor.go +++ b/samples/watersensor.go @@ -7,10 +7,10 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" - "github.com/zlowred/embd/sensor/watersensor" + "github.com/kidoman/embd" + "github.com/kidoman/embd/sensor/watersensor" - _ "github.com/zlowred/embd/host/all" + _ "github.com/kidoman/embd/host/all" ) func main() { diff --git a/sensor/bh1750fvi/bh1750fvi.go b/sensor/bh1750fvi/bh1750fvi.go index f774211..6903bb8 100644 --- a/sensor/bh1750fvi/bh1750fvi.go +++ b/sensor/bh1750fvi/bh1750fvi.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) //accuracy = sensorValue/actualValue] (min = 0.96, typ = 1.2, max = 1.44 diff --git a/sensor/bmp085/bmp085.go b/sensor/bmp085/bmp085.go index c8c184d..b58b37b 100644 --- a/sensor/bmp085/bmp085.go +++ b/sensor/bmp085/bmp085.go @@ -8,7 +8,7 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/sensor/bmp180/bmp180.go b/sensor/bmp180/bmp180.go index bcab5b3..fdc46f3 100644 --- a/sensor/bmp180/bmp180.go +++ b/sensor/bmp180/bmp180.go @@ -8,7 +8,7 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/sensor/l3gd20/l3gd20.go b/sensor/l3gd20/l3gd20.go index c59e2c8..c3ad94a 100644 --- a/sensor/l3gd20/l3gd20.go +++ b/sensor/l3gd20/l3gd20.go @@ -8,7 +8,7 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/sensor/lsm303/lsm303.go b/sensor/lsm303/lsm303.go index d390045..583a0a8 100644 --- a/sensor/lsm303/lsm303.go +++ b/sensor/lsm303/lsm303.go @@ -7,7 +7,7 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/sensor/tmp006/tmp006.go b/sensor/tmp006/tmp006.go index f6347e9..842204b 100644 --- a/sensor/tmp006/tmp006.go +++ b/sensor/tmp006/tmp006.go @@ -9,7 +9,7 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/sensor/us020/us020.go b/sensor/us020/us020.go index 83e581b..b7d400a 100644 --- a/sensor/us020/us020.go +++ b/sensor/us020/us020.go @@ -6,7 +6,7 @@ import ( "time" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) const ( diff --git a/sensor/watersensor/watersensor.go b/sensor/watersensor/watersensor.go index 7b1dfe5..c83628e 100644 --- a/sensor/watersensor/watersensor.go +++ b/sensor/watersensor/watersensor.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/golang/glog" - "github.com/zlowred/embd" + "github.com/kidoman/embd" ) // WaterSensor represents a water sensor. From 6e7e0c31bd588d4f41ec44c80e0c6b34ecc90174 Mon Sep 17 00:00:00 2001 From: Max Matveev Date: Sat, 6 Feb 2016 01:03:26 -0800 Subject: [PATCH 08/10] fixed locking when closing 1-wire bus --- host/rpi/onewirebus.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/host/rpi/onewirebus.go b/host/rpi/onewirebus.go index 6c76e8b..420b9d1 100644 --- a/host/rpi/onewirebus.go +++ b/host/rpi/onewirebus.go @@ -180,8 +180,6 @@ func (b *w1Bus) Close() error { } func (d *w1Device) Close() error { - d.bus.Mu.Lock() - defer d.bus.Mu.Unlock() if !d.initialized { return nil From 5c026ec7230f491e3f3a126446cca4891abb0fcf Mon Sep 17 00:00:00 2001 From: Max Matveev Date: Sat, 6 Feb 2016 19:27:58 -0800 Subject: [PATCH 09/10] removed debug println --- host/rpi/onewirebus.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/host/rpi/onewirebus.go b/host/rpi/onewirebus.go index 420b9d1..3c5a8ad 100644 --- a/host/rpi/onewirebus.go +++ b/host/rpi/onewirebus.go @@ -3,13 +3,13 @@ package rpi import ( - "fmt" "os" "sync" "github.com/golang/glog" "github.com/kidoman/embd" "io/ioutil" + "fmt" ) type w1Bus struct { @@ -28,7 +28,6 @@ type w1Device struct { } func NewW1Bus(l byte) embd.W1Bus { - fmt.Println("new w1 bus") return &w1Bus{l: l, busMap: make(map[string]embd.W1Device)} } From c868297e0ba3166e750871fb51f6a9c8630d55e1 Mon Sep 17 00:00:00 2001 From: Max Matveev Date: Sat, 6 Feb 2016 19:28:29 -0800 Subject: [PATCH 10/10] removed debug println --- host/rpi/onewirebus.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/host/rpi/onewirebus.go b/host/rpi/onewirebus.go index 3c5a8ad..b0426e1 100644 --- a/host/rpi/onewirebus.go +++ b/host/rpi/onewirebus.go @@ -3,28 +3,28 @@ package rpi import ( + "fmt" "os" "sync" "github.com/golang/glog" "github.com/kidoman/embd" "io/ioutil" - "fmt" ) type w1Bus struct { - l byte - busMap map[string]embd.W1Device - Mu sync.Mutex + l byte + busMap map[string]embd.W1Device + Mu sync.Mutex initialized bool } type w1Device struct { - file *os.File - addr string + file *os.File + addr string initialized bool - bus *w1Bus + bus *w1Bus } func NewW1Bus(l byte) embd.W1Bus { @@ -37,7 +37,7 @@ func (b *w1Bus) init() error { } var err error - if _, err = os.Stat("/sys/bus/w1"); os.IsNotExist(err) { + if _, err = os.Stat("/sys/bus/w1"); os.IsNotExist(err) { return err }