mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-11 17:14:41 +00:00
Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd77c548d2 | ||
|
|
022afabd30 | ||
|
|
ce17123325 | ||
|
|
f2346df4e5 | ||
|
|
94c659ba6d | ||
|
|
9c0298bad0 | ||
|
|
602b21fe9d |
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
<!-- refer to https://keepachangelog.com/en/1.0.0/ for guidance -->
|
||||
|
||||
## Unreleased
|
||||
## 3.1.0 - 2021-12-16
|
||||
|
||||
### Added
|
||||
- Added maximum voltage setter for `DCMotor` and `Motor`.
|
||||
|
||||
@@ -265,11 +265,14 @@ latex_documents = [
|
||||
exclude_patterns = [
|
||||
'ev3devices.rst',
|
||||
'hubs/ev3brick.rst',
|
||||
'hubs/primehub.rst',
|
||||
'geometry.rst',
|
||||
'iodevices/analogsensor.rst',
|
||||
'iodevices/dcmotor.rst',
|
||||
'iodevices/ev3devsensor.rst',
|
||||
'iodevices/i2cdevice.rst',
|
||||
'iodevices/lumpdevice.rst',
|
||||
'iodevices/lwp3device.rst',
|
||||
'iodevices/uartdevice.rst',
|
||||
'media.rst',
|
||||
'messaging.rst',
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
movehub
|
||||
cityhub
|
||||
technichub
|
||||
primehub
|
||||
|
||||
.. pybricks-classlink:: MoveHub
|
||||
|
||||
@@ -31,16 +30,3 @@
|
||||
.. figure:: ../../main/images/technichub.png
|
||||
:height: 10 em
|
||||
:target: technichub.html
|
||||
|
||||
.. pybricks-classlink:: PrimeHub
|
||||
|
||||
.. figure:: ../../main/images/primehub.png
|
||||
:height: 10 em
|
||||
:target: primehub.html
|
||||
|
||||
.. pybricks-classlink:: InventorHub PrimeHub
|
||||
|
||||
.. figure:: ../../main/images/inventorhub.png
|
||||
:height: 10 em
|
||||
:target: primehub.html
|
||||
|
||||
|
||||
@@ -6,8 +6,9 @@ Technic Hub
|
||||
.. figure:: ../../main/images/technichub.png
|
||||
:height: 15 em
|
||||
|
||||
.. autoclass:: pybricks.hubs.TechnicHub
|
||||
:no-members:
|
||||
.. class:: TechnicHub
|
||||
|
||||
LEGO® Technic Hub.
|
||||
|
||||
.. rubric:: Using the hub status light
|
||||
|
||||
@@ -19,20 +20,6 @@ Technic Hub
|
||||
|
||||
.. automethod:: pybricks.hubs::TechnicHub.light.animate
|
||||
|
||||
.. rubric:: Using the IMU
|
||||
|
||||
.. automethod:: pybricks.hubs::TechnicHub.imu.up
|
||||
|
||||
.. automethod:: pybricks.hubs::TechnicHub.imu.tilt
|
||||
|
||||
.. automethod:: pybricks.hubs::TechnicHub.imu.acceleration
|
||||
|
||||
.. automethod:: pybricks.hubs::TechnicHub.imu.angular_velocity
|
||||
|
||||
.. automethod:: pybricks.hubs::TechnicHub.imu.heading
|
||||
|
||||
.. automethod:: pybricks.hubs::TechnicHub.imu.reset_heading
|
||||
|
||||
.. rubric:: Using the battery
|
||||
|
||||
.. automethod:: pybricks.hubs::TechnicHub.battery.voltage
|
||||
@@ -78,40 +65,6 @@ Creating light animations
|
||||
.. literalinclude::
|
||||
../../../examples/pup/hub_technichub/light_animate.py
|
||||
|
||||
IMU examples
|
||||
---------------
|
||||
|
||||
Testing which way is up
|
||||
********************************
|
||||
|
||||
.. literalinclude::
|
||||
../../../examples/pup/hub_technichub/imu_up.py
|
||||
|
||||
|
||||
Reading the tilt value
|
||||
********************************
|
||||
|
||||
.. literalinclude::
|
||||
../../../examples/pup/hub_technichub/imu_tilt.py
|
||||
|
||||
Using a custom hub orientation
|
||||
**************************************************
|
||||
|
||||
.. literalinclude::
|
||||
../../../examples/pup/hub_technichub/imu_tilt_blast.py
|
||||
|
||||
Reading acceleration and angular velocity vectors
|
||||
**************************************************
|
||||
|
||||
.. literalinclude::
|
||||
../../../examples/pup/hub_technichub/imu_read_vector.py
|
||||
|
||||
Reading acceleration and angular velocity on one axis
|
||||
*****************************************************
|
||||
|
||||
.. literalinclude::
|
||||
../../../examples/pup/hub_technichub/imu_read_scalar.py
|
||||
|
||||
Button and system examples
|
||||
----------------------------------
|
||||
|
||||
|
||||
+1
-12
@@ -49,16 +49,6 @@ Pybricks Documentation
|
||||
|
||||
.. only:: ide
|
||||
|
||||
.. note::
|
||||
|
||||
**You are using a new beta version of Pybricks!**
|
||||
|
||||
This is great for trying the very latest features, but some things
|
||||
might not work.
|
||||
|
||||
If in doubt, use the `latest stable release`_. Please report any
|
||||
issues via our `support page`_. Thanks!
|
||||
|
||||
To begin, install the Pybricks firmware on your hub. Check
|
||||
`pybricks.com/install`_ to learn how.
|
||||
|
||||
@@ -67,7 +57,7 @@ Pybricks Documentation
|
||||
|
||||
.. rubric:: Programmable hubs
|
||||
|
||||
.. figure:: ../main/images/hubsoverview.png
|
||||
.. figure:: ../main/images/powereduphubs.png
|
||||
:width: 100 %
|
||||
:target: hubs/index.html
|
||||
|
||||
@@ -110,7 +100,6 @@ Pybricks Documentation
|
||||
parameters/index
|
||||
tools/index
|
||||
robotics
|
||||
geometry
|
||||
signaltypes
|
||||
|
||||
.. toctree::
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
:hidden:
|
||||
|
||||
pupdevice
|
||||
lwp3device
|
||||
|
||||
This module has classes for generic input/output devices.
|
||||
|
||||
@@ -19,9 +18,3 @@ This module has classes for generic input/output devices.
|
||||
.. figure:: ../../main/images/sensor_pup.png
|
||||
:width: 70 %
|
||||
:target: pupdevice.html
|
||||
|
||||
.. pybricks-classlink:: LWP3Device
|
||||
|
||||
.. figure:: ../../main/images/powereduphubs.png
|
||||
:width: 70 %
|
||||
:target: lwp3device.html
|
||||
|
||||
@@ -26,21 +26,6 @@ Side
|
||||
.. autoattribute:: pybricks.parameters.Side.RIGHT
|
||||
:annotation:
|
||||
|
||||
|
||||
Screens or light matrices have only four sides. For those,
|
||||
``TOP`` is treated the same as ``FRONT``, and ``BOTTOM`` is treated the
|
||||
same as ``BACK``. The diagrams below define the sides for relevant devices.
|
||||
|
||||
**Prime Hub**
|
||||
|
||||
.. figure:: ../../main/images/orientation_primehub_label.png
|
||||
:height: 17 em
|
||||
|
||||
**Inventor Hub**
|
||||
|
||||
.. figure:: ../../main/images/orientation_inventorhub_label.png
|
||||
:height: 17 em
|
||||
|
||||
**Move Hub**
|
||||
|
||||
.. figure:: ../../main/images/orientation_movehub_label.png
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "pybricks"
|
||||
version = "3.1.0rc1"
|
||||
version = "3.1.0"
|
||||
description = "Documentation and user-API stubs for Pybricks MicroPython"
|
||||
authors = ["The Pybricks Authors <dev@pybricks.com>"]
|
||||
maintainers = ["Laurens Valk <laurens@pybricks.com>", "David Lechner <david@pybricks.com>" ]
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Copyright (c) 2020 The Pybricks Authors
|
||||
# Copyright (c) 2020-2021 The Pybricks Authors
|
||||
|
||||
from pybricks.geometry import Matrix, vector
|
||||
from typing import Collection, Iterable, List, Optional, Tuple, Union, overload
|
||||
from typing import Collection, Iterable, Optional, Tuple, Union, overload
|
||||
|
||||
from .parameters import Button, Color, Direction, Side, Stop, Port, Axis
|
||||
from .geometry import Axis, Matrix, vector
|
||||
from .parameters import Button, Color, Direction, Side, Stop, Port
|
||||
from .media.ev3dev import SoundFile
|
||||
|
||||
class DCMotor:
|
||||
@@ -32,7 +32,6 @@ class Control:
|
||||
kp: Optional[int] = None,
|
||||
ki: Optional[int] = None,
|
||||
kd: Optional[int] = None,
|
||||
integral_range: Optional[int] = None,
|
||||
integral_rate: Optional[int] = None,
|
||||
) -> None: ...
|
||||
@overload
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Copyright (c) 2018-2020 The Pybricks Authors
|
||||
# Copyright (c) 2018-2021 The Pybricks Authors
|
||||
|
||||
"""Robotics module for the Pybricks API."""
|
||||
|
||||
@@ -100,8 +100,9 @@ class DriveBase:
|
||||
"""Resets the estimated driven distance and angle to 0."""
|
||||
pass
|
||||
|
||||
def settings(self, straight_speed, straight_acceleration, turn_rate,
|
||||
turn_acceleration):
|
||||
def settings(
|
||||
self, straight_speed, straight_acceleration, turn_rate, turn_acceleration
|
||||
):
|
||||
"""Configures the speed and acceleration used
|
||||
by :meth:`.straight`, :meth:`.turn`, and :meth:`.curve`.
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Copyright (c) 2020 The Pybricks Authors
|
||||
# Copyright (c) 2020-2021 The Pybricks Authors
|
||||
|
||||
from typing import Optional, Tuple, overload, Union
|
||||
|
||||
from ._common import Control, Motor
|
||||
from .parameters import Stop
|
||||
|
||||
class DriveBase:
|
||||
distance_control: Control
|
||||
@@ -32,3 +34,6 @@ class DriveBase:
|
||||
) -> None: ...
|
||||
def straight(self, distance: int) -> None: ...
|
||||
def turn(self, angle: int) -> None: ...
|
||||
def curve(
|
||||
self, radius: int, angle: int, then: Stop = Stop.HOLD, wait: bool = True
|
||||
) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user