From 96203992c9de5436d12be190e4e7fb6b541e307b Mon Sep 17 00:00:00 2001 From: Draho Date: Thu, 19 Aug 2021 03:39:30 +0200 Subject: [PATCH] Use v4 modules version in examples --- examples/blinker/blinker.go | 2 +- examples/event/event.go | 2 +- examples/pullup/pullup.go | 2 +- examples/pwm/pwm.go | 2 +- examples/spi/spi.go | 10 +++------- go.mod | 2 +- go.sum | 0 7 files changed, 8 insertions(+), 12 deletions(-) create mode 100644 go.sum diff --git a/examples/blinker/blinker.go b/examples/blinker/blinker.go index 8792b88..baea385 100644 --- a/examples/blinker/blinker.go +++ b/examples/blinker/blinker.go @@ -12,7 +12,7 @@ package main import ( "fmt" - "github.com/stianeikeland/go-rpio" + "github.com/stianeikeland/go-rpio/v4" "os" "time" ) diff --git a/examples/event/event.go b/examples/event/event.go index 66288c8..e47d6f2 100644 --- a/examples/event/event.go +++ b/examples/event/event.go @@ -15,7 +15,7 @@ import ( "os" "time" - "github.com/stianeikeland/go-rpio" + "github.com/stianeikeland/go-rpio/v4" ) var ( diff --git a/examples/pullup/pullup.go b/examples/pullup/pullup.go index 58fc9c7..adce4ae 100644 --- a/examples/pullup/pullup.go +++ b/examples/pullup/pullup.go @@ -2,7 +2,7 @@ package main import ( "fmt" - "github.com/stianeikeland/go-rpio" + "github.com/stianeikeland/go-rpio/v4" "os" ) diff --git a/examples/pwm/pwm.go b/examples/pwm/pwm.go index c34e52a..97a522f 100644 --- a/examples/pwm/pwm.go +++ b/examples/pwm/pwm.go @@ -12,7 +12,7 @@ package main import ( "os" "time" - "github.com/stianeikeland/go-rpio" + "github.com/stianeikeland/go-rpio/v4" ) func main() { diff --git a/examples/spi/spi.go b/examples/spi/spi.go index 8611327..31345fc 100644 --- a/examples/spi/spi.go +++ b/examples/spi/spi.go @@ -7,7 +7,7 @@ SPI example package main import ( - "github.com/stianeikeland/go-rpio" + "github.com/stianeikeland/go-rpio/v4" "fmt" ) @@ -22,22 +22,18 @@ func main() { rpio.SpiChipSelect(0) // Select CE0 slave - // Send - rpio.SpiTransmit(0xFF) // send single byte - rpio.SpiTransmit(0xDE, 0xAD, 0xBE) // send several bytes + rpio.SpiTransmit(0xDE, 0xAD, 0xBE) // send several bytes data := []byte{'H', 'e', 'l', 'l', 'o', 0} - rpio.SpiTransmit(data...) // send slice of bytes + rpio.SpiTransmit(data...) // send slice of bytes - // Receive received := rpio.SpiReceive(5) // receive 5 bytes, (sends 5 x 0s) fmt.Println(received) - // Send & Receive buffer := []byte{ 0xDE, 0xED, 0xBE, 0xEF } diff --git a/go.mod b/go.mod index b49f549..26f38ee 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module github.com/stianeikeland/go-rpio/v4 -go 1.13 +go 1.15 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..e69de29