Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Servo doesn't work on raspberry pi #753

Closed
rochinworks opened this issue Jun 7, 2020 · 2 comments
Closed

Servo doesn't work on raspberry pi #753

rochinworks opened this issue Jun 7, 2020 · 2 comments

Comments

@rochinworks
Copy link

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()
}
@a1xon
Copy link

a1xon commented Aug 10, 2020

https://raspberrypi.stackexchange.com/questions/70878/error-gpio-num-is-not-enabled-for-pi-blaster
You have to
sudo ./pi-blaster --gpio 13

edit: sorry running into the same problems. the RPi Servo modul doesnt work with piblaster. I'm writing my own servo function now with https://github.com/richardghirst/PiBits/tree/master/ServoBlaster in the background. gobot seems like a dead project :\

@gen2thomas
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants