31 lines
457 B
Go
31 lines
457 B
Go
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
|
|
}
|