neopixels: move Firmata driver to Neopixels into firmata package

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram 2017-06-24 13:05:36 +02:00
parent a18e58055c
commit f3dbe715e3
2 changed files with 4 additions and 5 deletions

View File

@ -15,7 +15,7 @@ import (
func main() {
firmataAdaptor := firmata.NewAdaptor("/dev/ttyACM0")
led := gpio.NewLedDriver(firmataAdaptor, "13")
neo := gpio.NewNeopixelDriver(firmataAdaptor, "6", 5)
neo := firmata.NewNeopixelDriver(firmataAdaptor, "6", 5)
work := func() {
cols := []uint32{0xff0000, 0x00ff00, 0x0000ff, 0xffff00, 0xffffff}

View File

@ -1,10 +1,9 @@
package gpio
package firmata
import (
"strconv"
"gobot.io/x/gobot"
"gobot.io/x/gobot/platforms/firmata"
)
const (
@ -28,12 +27,12 @@ type NeopixelDriver struct {
name string
pin string
pixelCount uint16
connection *firmata.Adaptor
connection *Adaptor
gobot.Eventer
}
// NewNeopixelDriver returns a new NeopixelDriver
func NewNeopixelDriver(a *firmata.Adaptor, pin string, pixelCount uint16) *NeopixelDriver {
func NewNeopixelDriver(a *Adaptor, pin string, pixelCount uint16) *NeopixelDriver {
neo := &NeopixelDriver{
name: gobot.DefaultName("Neopixel"),
connection: a,