[Nucleo-H743ZI2]Servo Object/Library

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
zum
Posts: 6
Joined: Fri Nov 19, 2021 1:39 pm

[Nucleo-H743ZI2]Servo Object/Library

Post by zum » Mon Dec 27, 2021 11:14 am

Hi everybody

I am a little a newbie in the world of MicroPython and experimenting with a Nucleo-H743ZI2 board.
So I couldn't create a servo object like written in the getting started tutorial https://docs.micropython.org/en/latest/ ... servo.html

Code: Select all

>>> servo1=pyb.servo(0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: function takes 2 positional arguments but 1 were given
What is the second argument and where can I find the right docs for the STM boards?


Thanks a lot already for the informations

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

Re: [Nucleo-H743ZI2]Servo Object/Library

Post by dhylands » Thu Dec 30, 2021 7:35 pm

Did you mean pyb.Servo(1) (i.e. capital S) That corresponds to this documentation: https://docs.micropython.org/en/latest/ ... Servo.html

The arguments to pyb.servo() are the servo number and the position. I'm going to guess that this is an older function that only exists for backwards compatability.

zum
Posts: 6
Joined: Fri Nov 19, 2021 1:39 pm

Re: [Nucleo-H743ZI2]Servo Object/Library

Post by zum » Thu Jan 06, 2022 4:47 pm

Thanks for the answer.

Ah I thought there would be like a second class to define servos at a other timer pin with a PWM.
So thanks for the answer then I will have to use the Timer 5 channels.

Post Reply