You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having trouble getting a servo to move on a raspberry pi using the go1.13. I have never been able to get this to work. Is there something I'm missing?
package main
import (
"time"
"fmt"
"gobot.io/x/gobot"
"gobot.io/x/gobot/drivers/gpio"
"gobot.io/x/gobot/platforms/raspi"
)
func main() {
r := raspi.NewAdaptor()
servo := gpio.NewServoDriver(r, "24")
work := func() {
servo.Center()
time.Sleep(1*time.Second)
fmt.Println("moving servo to center")
servo.Min()
time.Sleep(1*time.Second)
fmt.Println("moving servo to min")
servo.Max()
time.Sleep(1*time.Second)
fmt.Println("moving servo to max")
}
robot := gobot.NewRobot("servoBot",
[]gobot.Connection{r},
[]gobot.Device{servo},
work,
)
robot.Start()
}
The text was updated successfully, but these errors were encountered:
I'm going to close this issue as a duplicate, because it is now referenced by an issue which collect all the various problems with raspi and gpio.servo.
I am having trouble getting a servo to move on a raspberry pi using the go1.13. I have never been able to get this to work. Is there something I'm missing?
The text was updated successfully, but these errors were encountered: