mirror of
https://github.com/kidoman/embd
synced 2024-12-22 04:40:04 +01:00
kid0m4n/go-rpi -> kidoman/embd
This commit is contained in:
parent
c61631dc1a
commit
283e8eb140
28
README.md
28
README.md
@ -1,30 +1,30 @@
|
||||
# go-rpi
|
||||
# embd
|
||||
|
||||
Use various sensors on the RaspberryPi with Golang (like a ninja!)
|
||||
Golang Embedded Programming Framework
|
||||
|
||||
## Documentation
|
||||
|
||||
[![GoDoc](http://godoc.org/github.com/kid0m4n/go-rpi?status.png)](http://godoc.org/github.com/kid0m4n/go-rpi)
|
||||
[![GoDoc](http://godoc.org/github.com/kidoman/embd?status.png)](http://godoc.org/github.com/kidoman/embd)
|
||||
|
||||
## Protocols supported
|
||||
|
||||
* **I2C** [Documentation](http://godoc.org/github.com/kid0m4n/go-rpi/i2c)
|
||||
* **I2C** [Documentation](http://godoc.org/github.com/kidoman/embd/i2c)
|
||||
|
||||
## Sensors supported
|
||||
|
||||
* **TMP006** Thermopile sensor [Documentation](http://godoc.org/github.com/kid0m4n/go-rpi/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/kid0m4n/go-rpi/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/kid0m4n/go-rpi/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/kid0m4n/go-rpi/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/kid0m4n/go-rpi/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/kid0m4n/go-rpi/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/kid0m4n/go-rpi/sensor/us020), [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/us020), [Datasheet](http://www.elechouse.com/elechouse/images/product/Digital%20light%20Sensor/bh1750fvi-e.pdf)
|
||||
|
||||
## Interfaces
|
||||
|
||||
@ -32,8 +32,8 @@ Use various sensors on the RaspberryPi with Golang (like a ninja!)
|
||||
|
||||
## Controllers
|
||||
|
||||
* **PCA9685** 16-channel, 12-bit PWM Controller with I2C protocol [Documentation](http://godoc.org/github.com/kid0m4n/go-rpi/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/kid0m4n/go-rpi/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/kid0m4n/go-rpi/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)
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"log"
|
||||
"sync"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/i2c"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -7,8 +7,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/i2c"
|
||||
"github.com/kid0m4n/go-rpi/util"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
"github.com/kidoman/embd/util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
6
doc.go
6
doc.go
@ -3,7 +3,7 @@ Package rpi provides modules which will help gophers deal with various sensors.
|
||||
|
||||
Use the default i2c bus to read/write data:
|
||||
|
||||
import "github.com/kid0m4n/go-rpi/i2c"
|
||||
import "github.com/kidoman/embd/i2c"
|
||||
...
|
||||
value, err := i2c.ReadInt(0x1E, 0x03)
|
||||
...
|
||||
@ -14,7 +14,7 @@ Use the default i2c bus to read/write data:
|
||||
|
||||
Read data from the BMP085 sensor:
|
||||
|
||||
import "github.com/kid0m4n/go-rpi/sensor/bmp085"
|
||||
import "github.com/kidoman/embd/sensor/bmp085"
|
||||
...
|
||||
temp, err := bmp085.Temperature()
|
||||
...
|
||||
@ -22,7 +22,7 @@ Read data from the BMP085 sensor:
|
||||
|
||||
Find out the heading from the LSM303 magnetometer:
|
||||
|
||||
import "github.com/kid0m4n/go-rpi/sensor/lsm303"
|
||||
import "github.com/kidoman/embd/sensor/lsm303"
|
||||
...
|
||||
heading, err := lsm303.Heading()
|
||||
*/
|
||||
|
@ -4,7 +4,7 @@ package servo
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/util"
|
||||
"github.com/kidoman/embd/util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/i2c"
|
||||
"github.com/kid0m4n/go-rpi/sensor/bh1750fvi"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
"github.com/kidoman/embd/sensor/bh1750fvi"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/i2c"
|
||||
"github.com/kid0m4n/go-rpi/sensor/bmp085"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
"github.com/kidoman/embd/sensor/bmp085"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/i2c"
|
||||
"github.com/kid0m4n/go-rpi/sensor/bmp180"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
"github.com/kidoman/embd/sensor/bmp180"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/interface/keypad/matrix4x3"
|
||||
"github.com/kidoman/embd/interface/keypad/matrix4x3"
|
||||
"github.com/stianeikeland/go-rpio"
|
||||
)
|
||||
|
||||
|
@ -6,8 +6,8 @@ import (
|
||||
"os/signal"
|
||||
"time"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/i2c"
|
||||
"github.com/kid0m4n/go-rpi/sensor/l3gd20"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
"github.com/kidoman/embd/sensor/l3gd20"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/i2c"
|
||||
"github.com/kid0m4n/go-rpi/sensor/lsm303"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
"github.com/kidoman/embd/sensor/lsm303"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -6,8 +6,8 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/controller/mcp4725"
|
||||
"github.com/kid0m4n/go-rpi/i2c"
|
||||
"github.com/kidoman/embd/controller/mcp4725"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -6,8 +6,8 @@ import (
|
||||
"os/signal"
|
||||
"time"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/controller/pca9685"
|
||||
"github.com/kid0m4n/go-rpi/i2c"
|
||||
"github.com/kidoman/embd/controller/pca9685"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -6,9 +6,9 @@ import (
|
||||
"os/signal"
|
||||
"time"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/controller/pca9685"
|
||||
"github.com/kid0m4n/go-rpi/i2c"
|
||||
"github.com/kid0m4n/go-rpi/motion/servo"
|
||||
"github.com/kidoman/embd/controller/pca9685"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
"github.com/kidoman/embd/motion/servo"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -6,8 +6,8 @@ import (
|
||||
"os/signal"
|
||||
"time"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/controller/servoblaster"
|
||||
"github.com/kid0m4n/go-rpi/motion/servo"
|
||||
"github.com/kidoman/embd/controller/servoblaster"
|
||||
"github.com/kidoman/embd/motion/servo"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -2,7 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/kid0m4n/go-rpi/spi"
|
||||
"github.com/kidoman/embd/spi"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -5,8 +5,8 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/i2c"
|
||||
"github.com/kid0m4n/go-rpi/sensor/tmp006"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
"github.com/kidoman/embd/sensor/tmp006"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/sensor/us020"
|
||||
"github.com/kidoman/embd/sensor/us020"
|
||||
"github.com/stianeikeland/go-rpio"
|
||||
)
|
||||
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/sensor/watersensor"
|
||||
"github.com/kidoman/embd/sensor/watersensor"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@ -15,11 +15,11 @@ func main() {
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
if isWater {
|
||||
log.Printf("Bot is dry")
|
||||
} else {
|
||||
log.Printf("Bot is Wet")
|
||||
}
|
||||
if isWater {
|
||||
log.Printf("Bot is dry")
|
||||
} else {
|
||||
log.Printf("Bot is Wet")
|
||||
}
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/i2c"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
)
|
||||
|
||||
//accuracy = sensorValue/actualValue] (min = 0.96, typ = 1.2, max = 1.44
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/i2c"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/i2c"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/i2c"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/i2c"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/kid0m4n/go-rpi/i2c"
|
||||
"github.com/kidoman/embd/i2c"
|
||||
)
|
||||
|
||||
const (
|
||||
|
Loading…
x
Reference in New Issue
Block a user