Update i2c package
This commit is contained in:
parent
20395a016e
commit
51bd9247e7
|
@ -10,9 +10,10 @@ type BlinkMDriver struct {
|
||||||
Adaptor I2cInterface
|
Adaptor I2cInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewBlinkMDriver(a I2cInterface) *BlinkMDriver {
|
func NewBlinkMDriver(a I2cInterface, name string) *BlinkMDriver {
|
||||||
return &BlinkMDriver{
|
return &BlinkMDriver{
|
||||||
Driver: gobot.Driver{
|
Driver: gobot.Driver{
|
||||||
|
Name: name,
|
||||||
Commands: []string{
|
Commands: []string{
|
||||||
"RgbC",
|
"RgbC",
|
||||||
"FadeC",
|
"FadeC",
|
||||||
|
|
|
@ -12,7 +12,7 @@ var _ = Describe("BlinkM", func() {
|
||||||
)
|
)
|
||||||
|
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
b = NewBlinkMDriver(t)
|
b = NewBlinkMDriver(t, "bot")
|
||||||
})
|
})
|
||||||
|
|
||||||
It("Must be able to Start", func() {
|
It("Must be able to Start", func() {
|
||||||
|
|
|
@ -11,8 +11,11 @@ type HMC6352Driver struct {
|
||||||
Heading uint16
|
Heading uint16
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewHMC6352Driver(a I2cInterface) *HMC6352Driver {
|
func NewHMC6352Driver(a I2cInterface, name string) *HMC6352Driver {
|
||||||
return &HMC6352Driver{
|
return &HMC6352Driver{
|
||||||
|
Driver: gobot.Driver{
|
||||||
|
Name: name,
|
||||||
|
},
|
||||||
Adaptor: a,
|
Adaptor: a,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ var _ = Describe("HMC6352", func() {
|
||||||
)
|
)
|
||||||
|
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
h = NewHMC6352Driver(t)
|
h = NewHMC6352Driver(t, "bot")
|
||||||
})
|
})
|
||||||
|
|
||||||
It("Must be able to Start", func() {
|
It("Must be able to Start", func() {
|
||||||
|
|
|
@ -13,9 +13,10 @@ type WiichuckDriver struct {
|
||||||
data map[string]float64
|
data map[string]float64
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewWiichuckDriver(a I2cInterface) *WiichuckDriver {
|
func NewWiichuckDriver(a I2cInterface, name string) *WiichuckDriver {
|
||||||
return &WiichuckDriver{
|
return &WiichuckDriver{
|
||||||
Driver: gobot.Driver{
|
Driver: gobot.Driver{
|
||||||
|
Name: name,
|
||||||
Events: map[string]chan interface{}{
|
Events: map[string]chan interface{}{
|
||||||
"z_button": make(chan interface{}),
|
"z_button": make(chan interface{}),
|
||||||
"c_button": make(chan interface{}),
|
"c_button": make(chan interface{}),
|
||||||
|
|
|
@ -12,7 +12,7 @@ var _ = Describe("Wiichuck", func() {
|
||||||
)
|
)
|
||||||
|
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
w = NewWiichuckDriver(t)
|
w = NewWiichuckDriver(t, "bot")
|
||||||
})
|
})
|
||||||
|
|
||||||
PIt("Must be able to Start", func() {
|
PIt("Must be able to Start", func() {
|
||||||
|
|
Loading…
Reference in New Issue