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