mirror of
https://github.com/kidoman/embd
synced 2025-07-03 03:47:33 +02:00
Added SPI Library
This commit is contained in:
parent
f61f69e51e
commit
3843fd4ddf
2 changed files with 213 additions and 0 deletions
18
samples/spi.go
Normal file
18
samples/spi.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/kid0m4n/go-rpi/spi"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var rx_data uint8
|
||||
|
||||
fmt.Println("Hello")
|
||||
|
||||
bus, _ := spi.NewSpiBus()
|
||||
|
||||
rx_data, _ = bus.TransferAndRecieveByteData(8` )
|
||||
|
||||
fmt.Printf("Received %v \n", rx_data)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue