View: 1159|Reply: 2

PiCar Pro How to test Ad002 micro servos on the Robot Hat?

[Copy link]

2

Threads

2

Posts

24

Credits

Newbie

Rank: 1

Credits
24
Post time 2021-5-16 09:00:21 | Show all posts |Read mode
Ive connected the Raspberry Pi 3b+ to the Robot Hat via the GPIO Pins, Web server and camera work fine. Tried two Ad002 servos on PIN 0, running the command sudo python3 servo.py, the script runs fine, but nothing happens to the servos, no movement, no sound to indicate the servos are working. Whether i use two 4 amp batteries or supply power from the power adapter, there is no life from the servos. How do i test if the pins are working, if the servos are working, im a newb,any suggestions welcomed. - Thanks
Reply

Use magic Report

1

Threads

3

Posts

4

Credits

Newbie

Rank: 1

Credits
4
Post time 2021-7-24 11:03:50 | Show all posts
Not really a noob, but I'm having the same issue.  Did you get it resolved?
Reply

Use magic Report

1

Threads

3

Posts

4

Credits

Newbie

Rank: 1

Credits
4
Post time 2021-7-26 02:12:24 | Show all posts
I found the problem in the code.  In the main function, change the set_pwm parameters to:
      pwm.set_pwm(0,0,(300+i))
and
      pwm.set_pwm(0,0,(400-i))

That gets the servo moving.  
Reply

Use magic Report

You have to log in before you can reply Login | Sign Up

Points Rules