diff --git a/devices/bme280/bme280_test.go b/devices/bme280/bme280_test.go index ebc86bb..a4a3419 100644 --- a/devices/bme280/bme280_test.go +++ b/devices/bme280/bme280_test.go @@ -140,7 +140,7 @@ func TestCalibrationInt(t *testing.T) { // func Example() { - bus, err := i2c.New(-1) + bus, err := i2c.OpenByName("") if err != nil { log.Fatalf("failed to open I²C: %v", err) } diff --git a/devices/ds248x/ds248x_test.go b/devices/ds248x/ds248x_test.go index 961c2a3..9c30040 100644 --- a/devices/ds248x/ds248x_test.go +++ b/devices/ds248x/ds248x_test.go @@ -32,7 +32,7 @@ func TestInit(t *testing.T) { func Example() { // Open the I²C bus to which the DS248x is connected. - i2cBus, err := i2c.New(-1) + i2cBus, err := i2c.OpenByName("") if err != nil { fmt.Println(err) return @@ -72,7 +72,7 @@ func TestRecordInit(t *testing.T) { } host.Init() - i2cReal, err := i2c.New(-1) + i2cReal, err := i2c.OpenByName("") if err != nil { t.Fatal(err) } diff --git a/devices/ssd1306/ssd1306_test.go b/devices/ssd1306/ssd1306_test.go index 1100863..5a11f14 100644 --- a/devices/ssd1306/ssd1306_test.go +++ b/devices/ssd1306/ssd1306_test.go @@ -77,7 +77,7 @@ func TestDraw1D(t *testing.T) { // func Example() { - bus, err := i2c.New(-1) + bus, err := i2c.OpenByName("") if err != nil { log.Fatalf("failed to open I²C: %v", err) }