I cant set the reset_angle parameter to false in the EV3 using micropythons , im using VSC

102 Views Asked by At

I want that the Motors on the EV3 keep the current value, so my program knows where it left off last time.

This is the Code i am using:

#!/usr/bin/env pybricks-micropython
from pybricks import ev3brick as brick
from pybricks.ev3devices import Motor
from pybricks.parameters import Port, Direction, Stop
from pybricks.tools import wait

# Initialize motors
motor_left_upper = Motor(Port.D,Direction.CLOCKWISE,gears=None,reset_angle=False)

In the Docs is clearly described that the Motor has the attribute reset_angle as a bool variable in the constructor. https://docs.pybricks.com/en/stable/pupdevices/motor.html#movement-examples

I even have checked in the installed pybricks library path in my computer if the constructor matches with the documentation. And it do matches.

So i can't explain to myself why everytime i get the following error:

Traceback (most recent call last):
  File "/home/robot/Xani/main.py", line 12, in <module>
TypeError: extra keyword arguments given

If i leave the last argument reset_angle away it compiles fine.

I had this idea of going to the constructor and setting the default parameter from True to false, but i dont know how the find the pybricks library installed on the EV3, i tried searching for it but had no luck.

I would be very happy for any help, thanks in advance.

2

There are 2 best solutions below

0
On

Based on changelog at github Class MOTOR() received optional keyword argument reset_angle=False on 2021-07-19. This implies me that your pybricks micropython version is lower than 3.1.0a3

0
On

MicroPython for EV3 still uses Pybricks V2.0. You can find the corresponding documentation here: https://pybricks.com/ev3-micropython/

The reset_angle motor parameter was added in Pybricks V3.1.