diff --git a/platforms/firmata/firmata_adaptor_test.go b/platforms/firmata/firmata_adaptor_test.go index fb9ab8575..8a7d5985d 100644 --- a/platforms/firmata/firmata_adaptor_test.go +++ b/platforms/firmata/firmata_adaptor_test.go @@ -12,7 +12,7 @@ var _ = Describe("FirmataAdaptor", func() { ) BeforeEach(func() { - adaptor = NewFirmataAdaptor() + adaptor = NewFirmataAdaptor("tom", "/dev/null") adaptor.connect = func(f *FirmataAdaptor) { f.Board = newBoard(sp{}) f.Board.Events = append(f.Board.Events, event{Name: "firmware_query"}) diff --git a/platforms/gpio/led_driver_test.go b/platforms/gpio/led_driver_test.go index 239d861e2..25ccb37cf 100644 --- a/platforms/gpio/led_driver_test.go +++ b/platforms/gpio/led_driver_test.go @@ -12,8 +12,7 @@ var _ = Describe("Led", func() { ) BeforeEach(func() { - l = NewLedDriver(t) - l.Pin = "1" + l = NewLedDriver(t, "myLed", "1") }) It("Must be able to tell if IsOn", func() { diff --git a/platforms/i2c/hmc6352_driver.go b/platforms/i2c/hmc6352_driver.go index f4e0982a2..69949adf0 100644 --- a/platforms/i2c/hmc6352_driver.go +++ b/platforms/i2c/hmc6352_driver.go @@ -2,6 +2,7 @@ package i2c import ( "github.com/hybridgroup/gobot" + "time" ) type HMC6352Driver struct { @@ -20,7 +21,7 @@ func (h *HMC6352Driver) Start() bool { h.Adaptor.I2cStart(0x21) h.Adaptor.I2cWrite([]uint16{uint16([]byte("A")[0])}) - gobot.Every("1s", func() { + gobot.Every(1*time.Second, func() { h.Adaptor.I2cWrite([]uint16{uint16([]byte("A")[0])}) ret := h.Adaptor.I2cRead(2) if len(ret) == 2 { diff --git a/platforms/i2c/wiichuck_driver.go b/platforms/i2c/wiichuck_driver.go index ff9200b2c..5dda9a606 100644 --- a/platforms/i2c/wiichuck_driver.go +++ b/platforms/i2c/wiichuck_driver.go @@ -3,6 +3,7 @@ package i2c import ( "fmt" "github.com/hybridgroup/gobot" + "time" ) type WiichuckDriver struct { @@ -36,7 +37,7 @@ func NewWiichuckDriver(a I2cInterface) *WiichuckDriver { func (w *WiichuckDriver) Start() bool { w.Adaptor.I2cStart(byte(0x52)) - gobot.Every("100ms", func() { + gobot.Every(100*time.Millisecond, func() { w.Adaptor.I2cWrite([]uint16{uint16(0x40), uint16(0x00)}) w.Adaptor.I2cWrite([]uint16{uint16(0x00)}) new_value := w.Adaptor.I2cRead(uint16(6))