1
0
Fork 0
mirror of https://github.com/kidoman/embd synced 2025-07-04 20:37:46 +02:00

Standalone fork no longer dependant on the original.

This commit is contained in:
clinton 2017-05-20 18:36:48 +10:00
parent d3a9b3ff21
commit 9a25ce11c3
72 changed files with 187 additions and 187 deletions

View file

@ -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/cfreeman/embd?status.png)](http://godoc.org/github.com/cfreeman/embd)
**embd** is a hardware abstraction layer (HAL) for embedded systems.
@ -21,7 +21,7 @@ that are connected to gpio pins or one of the buses.
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/cfreeman/embd/wiki/Why-Go)
[Blog post introducing EMBD](http://kidoman.io/framework/embd.html)
@ -37,8 +37,8 @@ package main
import (
"time"
"github.com/kidoman/embd"
_ "github.com/kidoman/embd/host/rpi" // This loads the RPi driver
"github.com/cfreeman/embd"
_ "github.com/cfreeman/embd/host/rpi" // This loads the RPi driver
)
func main() {
@ -51,7 +51,7 @@ func main() {
Then install the EMBD package:
$ go get github.com/kidoman/embd
$ go get github.com/cfreeman/embd
Build the binary for linux/ARM:
@ -74,7 +74,7 @@ Then on the rPi run the program with ```sudo```*:
* 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)
see the [full version](https://github.com/cfreeman/embd/blob/master/samples/fullblinker.go)
## Getting Help
@ -89,7 +89,7 @@ Join the [slack channel](https://gophers.slack.com/archives/embd)
## The command line tool
go get github.com/kidoman/embd/embd
go get github.com/cfreeman/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.
@ -107,14 +107,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/cfreeman/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/cfreeman/embd"
import _ "github.com/cfreeman/embd/host/all"
...
embd.InitLED()
defer embd.CloseLED()
@ -127,8 +127,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/cfreeman/embd"
import _ "github.com/cfreeman/embd/host/all"
...
embd.InitLED()
defer embd.CloseLED()
@ -141,8 +141,8 @@ embd.ToggleLED(3)
BBB + **PWM**:
```go
import "github.com/kidoman/embd"
import _ "github.com/kidoman/embd/host/all"
import "github.com/cfreeman/embd"
import _ "github.com/cfreeman/embd/host/all"
...
embd.InitGPIO()
defer embd.CloseGPIO()
@ -156,8 +156,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/cfreeman/embd"
import _ "github.com/cfreeman/embd/host/all"
...
embd.InitGPIO()
defer embd.CloseGPIO()
@ -169,8 +169,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/cfreeman/embd"
import _ "github.com/cfreeman/embd/host/all"
...
embd.InitGPIO()
defer embd.CloseGPIO()
@ -184,9 +184,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/cfreeman/embd"
import "github.com/cfreeman/embd/sensor/bmp085"
import _ "github.com/cfreeman/embd/host/all"
...
bus := embd.NewI2CBus(1)
...
@ -199,9 +199,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/cfreeman/embd"
import "github.com/cfreeman/embd/sensor/lsm303"
import _ "github.com/cfreeman/embd/host/all"
...
bus := embd.NewI2CBus(1)
...
@ -215,22 +215,22 @@ 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/cfreeman/embd#DigitalPin)
* **Analog GPIO** [Documentation](http://godoc.org/github.com/cfreeman/embd#AnalogPin)
* **PWM** [Documentation](http://godoc.org/github.com/cfreeman/embd#PWMPin)
* **I2C** [Documentation](http://godoc.org/github.com/cfreeman/embd#I2CBus)
* **LED** [Documentation](http://godoc.org/github.com/cfreeman/embd#LED)
* **SPI** [Documentation](http://godoc.org/github.com/cfreeman/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)
* **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/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/kidoman/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)
* **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/kidoman/embd/sensor/bh1750fvi), [Datasheet](http://www.elechouse.com/elechouse/images/product/Digital%20light%20Sensor/bh1750fvi-e.pdf)
* **TMP006** Thermopile sensor [Documentation](http://godoc.org/github.com/cfreeman/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/cfreeman/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/cfreeman/embd/sensor/bmp180), [Datasheet](http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf)
* **LSM303** Accelerometer and magnetometer [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/lsm303), [Datasheet](https://www.sparkfun.com/datasheets/Sensors/Magneto/LSM303%20Datasheet.pdf)
* **L3GD20** Gyroscope [Documentation](http://godoc.org/github.com/cfreeman/embd/sensor/l3gd20), [Datasheet](http://www.adafruit.com/datasheets/L3GD20.pdf)
* **US020** Ultrasonic proximity sensor [Documentation](http://godoc.org/github.com/cfreeman/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/cfreeman/embd/sensor/bh1750fvi), [Datasheet](http://www.elechouse.com/elechouse/images/product/Digital%20light%20Sensor/bh1750fvi-e.pdf)
## Interfaces
@ -238,9 +238,9 @@ 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)
* **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/kidoman/embd/controller/servoblaster), [Product Page](https://github.com/richardghirst/PiBits/tree/master/ServoBlaster)
* **PCA9685** 16-channel, 12-bit PWM Controller with I2C protocol [Documentation](http://godoc.org/github.com/cfreeman/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/cfreeman/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/cfreeman/embd/controller/servoblaster), [Product Page](https://github.com/richardghirst/PiBits/tree/master/ServoBlaster)
## Convertors
@ -248,12 +248,12 @@ platforms.
## Contributing
[Pull requests](https://github.com/kidoman/embd/pulls) that follow the
[guidelines](https://github.com/kidoman/embd/blob/master/CONTRIBUTING.md) are very appreciated.
[Pull requests](https://github.com/cfreeman/embd/pulls) that follow the
[guidelines](https://github.com/cfreeman/embd/blob/master/CONTRIBUTING.md) are very appreciated.
If you find a problem but are not up to coding a fix please file an
[issue](https://github.com/kidoman/embd/issues).
[issue](https://github.com/cfreeman/embd/issues).
Thank you!
## 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/cfreeman/embd/blob/master/AUTHORS). We also have a list of [CONTRIBUTORS](https://github.com/cfreeman/embd/blob/master/CONTRIBUTORS).