first commit
This commit is contained in:
commit
a5a0434432
1126 changed files with 439481 additions and 0 deletions
23
Software/Go/grovepi_dht.go
Normal file
23
Software/Go/grovepi_dht.go
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/JGrotex/GrovePi/Software/Go/grovepi"
|
||||
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func runDHT() string {
|
||||
var g grovepi.GrovePi
|
||||
g = *grovepi.InitGrovePi(0x04)
|
||||
defer g.CloseDevice()
|
||||
|
||||
t, h, err := g.ReadDHT(grovepi.D4)
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Printf("Temperature: %f - Humidity: %f\n", t, h)
|
||||
|
||||
return "done"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue