Page 1 of 1

Servo not working

Posted: Thu Dec 22, 2016 10:56 pm
by harambecute101
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?

Re: Servo not working

Posted: Thu Dec 22, 2016 11:09 pm
by deshipu
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?

Re: Servo not working

Posted: Thu Dec 22, 2016 11:41 pm
by harambecute101
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.

Re: Servo not working

Posted: Fri Dec 23, 2016 5:13 am
by dhylands
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.