mpu/main.go

31 lines
457 B
Go
Raw Normal View History

2024-07-24 11:29:00 +00:00
package main
import (
"log"
"github.com/CGSG-2021-AE4/mpu-test/mpu6050"
)
func main() {
log.Println("CGSG forever!!!")
if err := mainE(); err != nil {
log.Println("MAIN finished with error:", err.Error())
}
log.Println("END")
}
func mainE() error {
log.Println("OPEN")
mpu, err := mpu6050.Open()
if err != nil {
return err
}
log.Println("GET")
temp, err := mpu.GetTemp()
if err != nil {
return err
}
log.Println(temp)
return nil
}