Added Test
This commit is contained in:
parent
a5b84ab9ce
commit
ee64ad9d61
1 changed files with 5 additions and 4 deletions
|
@ -1,14 +1,14 @@
|
||||||
package main
|
package rfm69
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
|
||||||
"github.com/fulr/rfm69"
|
|
||||||
"github.com/kidoman/embd"
|
"github.com/kidoman/embd"
|
||||||
_ "github.com/kidoman/embd/host/all"
|
_ "github.com/kidoman/embd/host/all"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func TestRfm69(t *testing.T) {
|
||||||
fmt.Print("Test")
|
fmt.Print("Test")
|
||||||
|
|
||||||
if err := embd.InitSPI(); err != nil {
|
if err := embd.InitSPI(); err != nil {
|
||||||
|
@ -19,8 +19,9 @@ func main() {
|
||||||
spiBus := embd.NewSPIBus(embd.SPIMode0, 0, 4000000, 8, 0)
|
spiBus := embd.NewSPIBus(embd.SPIMode0, 0, 4000000, 8, 0)
|
||||||
defer spiBus.Close()
|
defer spiBus.Close()
|
||||||
|
|
||||||
rfm, err := rfm69.NewDevice(spiBus, 1, 10, true)
|
rfm, err := NewDevice(spiBus, 1, 10, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
print(rfm)
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue