Use v4 modules version in examples

This commit is contained in:
Draho 2021-08-19 03:39:30 +02:00
parent 6ea7dcc05f
commit 96203992c9
7 changed files with 8 additions and 12 deletions

View File

@ -12,7 +12,7 @@ package main
import (
"fmt"
"github.com/stianeikeland/go-rpio"
"github.com/stianeikeland/go-rpio/v4"
"os"
"time"
)

View File

@ -15,7 +15,7 @@ import (
"os"
"time"
"github.com/stianeikeland/go-rpio"
"github.com/stianeikeland/go-rpio/v4"
)
var (

View File

@ -2,7 +2,7 @@ package main
import (
"fmt"
"github.com/stianeikeland/go-rpio"
"github.com/stianeikeland/go-rpio/v4"
"os"
)

View File

@ -12,7 +12,7 @@ package main
import (
"os"
"time"
"github.com/stianeikeland/go-rpio"
"github.com/stianeikeland/go-rpio/v4"
)
func main() {

View File

@ -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 }

2
go.mod
View File

@ -1,3 +1,3 @@
module github.com/stianeikeland/go-rpio/v4
go 1.13
go 1.15

0
go.sum Normal file
View File