Servo not working

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
harambecute101
Posts: 12
Joined: Mon Nov 28, 2016 10:04 pm

Servo not working

Post by harambecute101 » Thu Dec 22, 2016 10:56 pm

Hi,
My servos, all of them,. aren't working with my pyboard when I use them in the REPL.
With the on-board script the servos work fine. They just don't work in the serial terminal.
Any solutions?

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Servo not working

Post by deshipu » Thu Dec 22, 2016 11:09 pm

What do you mean exactly by "don't work"? How are you connecting them? What commands are you giving? What is the expected result, and what do you get instead? Do you have a minimal example that demonstrates the problem?

harambecute101
Posts: 12
Joined: Mon Nov 28, 2016 10:04 pm

Re: Servo not working

Post by harambecute101 » Thu Dec 22, 2016 11:41 pm

Like, If I connect my servos to one of the servo pins on the pyboard, and type in something like, I don't know, pyb.Servo(4).angle(90, 1000), the servos don't move at all. I checked all my solder connections, and so far I don't see any problems.
Also the servos now don't work at all, even in the on-board script.

Edit:
Oh, it was working, but strangely myt servo pins X1 to X4 were all actually labeled wrong.
Like, if I connected a servo to X2, I would have to type the servo as pyb.Servo(4), and for pin X1, pyb.Servo(3), and so on.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Servo not working

Post by dhylands » Fri Dec 23, 2016 5:13 am

I think that's a bug in the code.

On the PYBV10, the mapping is

A0 - X1
A1 - X2
A2 - X3
A3 - X4

On the PYBLITE, the mapping was changed:

A2 - X1
A3 - X2
A0 - X3
A1 - X4

I think that the Servo class should change the pins around for PYBLITE.

Post Reply