mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 01:24:17 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73d794dfb8 | ||
|
|
dd77c548d2 | ||
|
|
022afabd30 | ||
|
|
ce17123325 | ||
|
|
f2346df4e5 | ||
|
|
94c659ba6d | ||
|
|
9c0298bad0 | ||
|
|
602b21fe9d |
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<!-- refer to https://keepachangelog.com/en/1.0.0/ for guidance -->
|
<!-- refer to https://keepachangelog.com/en/1.0.0/ for guidance -->
|
||||||
|
|
||||||
## Unreleased
|
## 3.1.0 - 2021-12-16
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- Added maximum voltage setter for `DCMotor` and `Motor`.
|
- Added maximum voltage setter for `DCMotor` and `Motor`.
|
||||||
|
|||||||
@@ -265,11 +265,14 @@ latex_documents = [
|
|||||||
exclude_patterns = [
|
exclude_patterns = [
|
||||||
'ev3devices.rst',
|
'ev3devices.rst',
|
||||||
'hubs/ev3brick.rst',
|
'hubs/ev3brick.rst',
|
||||||
|
'hubs/primehub.rst',
|
||||||
|
'geometry.rst',
|
||||||
'iodevices/analogsensor.rst',
|
'iodevices/analogsensor.rst',
|
||||||
'iodevices/dcmotor.rst',
|
'iodevices/dcmotor.rst',
|
||||||
'iodevices/ev3devsensor.rst',
|
'iodevices/ev3devsensor.rst',
|
||||||
'iodevices/i2cdevice.rst',
|
'iodevices/i2cdevice.rst',
|
||||||
'iodevices/lumpdevice.rst',
|
'iodevices/lumpdevice.rst',
|
||||||
|
'iodevices/lwp3device.rst',
|
||||||
'iodevices/uartdevice.rst',
|
'iodevices/uartdevice.rst',
|
||||||
'media.rst',
|
'media.rst',
|
||||||
'messaging.rst',
|
'messaging.rst',
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
movehub
|
movehub
|
||||||
cityhub
|
cityhub
|
||||||
technichub
|
technichub
|
||||||
primehub
|
|
||||||
|
|
||||||
.. pybricks-classlink:: MoveHub
|
.. pybricks-classlink:: MoveHub
|
||||||
|
|
||||||
@@ -31,16 +30,3 @@
|
|||||||
.. figure:: ../../main/images/technichub.png
|
.. figure:: ../../main/images/technichub.png
|
||||||
:height: 10 em
|
:height: 10 em
|
||||||
:target: technichub.html
|
: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
|
.. figure:: ../../main/images/technichub.png
|
||||||
:height: 15 em
|
:height: 15 em
|
||||||
|
|
||||||
.. autoclass:: pybricks.hubs.TechnicHub
|
.. class:: TechnicHub
|
||||||
:no-members:
|
|
||||||
|
LEGO® Technic Hub.
|
||||||
|
|
||||||
.. rubric:: Using the hub status light
|
.. rubric:: Using the hub status light
|
||||||
|
|
||||||
@@ -19,20 +20,6 @@ Technic Hub
|
|||||||
|
|
||||||
.. automethod:: pybricks.hubs::TechnicHub.light.animate
|
.. 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
|
.. rubric:: Using the battery
|
||||||
|
|
||||||
.. automethod:: pybricks.hubs::TechnicHub.battery.voltage
|
.. automethod:: pybricks.hubs::TechnicHub.battery.voltage
|
||||||
@@ -78,40 +65,6 @@ Creating light animations
|
|||||||
.. literalinclude::
|
.. literalinclude::
|
||||||
../../../examples/pup/hub_technichub/light_animate.py
|
../../../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
|
Button and system examples
|
||||||
----------------------------------
|
----------------------------------
|
||||||
|
|
||||||
|
|||||||
+1
-12
@@ -49,16 +49,6 @@ Pybricks Documentation
|
|||||||
|
|
||||||
.. only:: ide
|
.. 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
|
To begin, install the Pybricks firmware on your hub. Check
|
||||||
`pybricks.com/install`_ to learn how.
|
`pybricks.com/install`_ to learn how.
|
||||||
|
|
||||||
@@ -67,7 +57,7 @@ Pybricks Documentation
|
|||||||
|
|
||||||
.. rubric:: Programmable hubs
|
.. rubric:: Programmable hubs
|
||||||
|
|
||||||
.. figure:: ../main/images/hubsoverview.png
|
.. figure:: ../main/images/powereduphubs.png
|
||||||
:width: 100 %
|
:width: 100 %
|
||||||
:target: hubs/index.html
|
:target: hubs/index.html
|
||||||
|
|
||||||
@@ -110,7 +100,6 @@ Pybricks Documentation
|
|||||||
parameters/index
|
parameters/index
|
||||||
tools/index
|
tools/index
|
||||||
robotics
|
robotics
|
||||||
geometry
|
|
||||||
signaltypes
|
signaltypes
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
:hidden:
|
:hidden:
|
||||||
|
|
||||||
pupdevice
|
pupdevice
|
||||||
lwp3device
|
|
||||||
|
|
||||||
This module has classes for generic input/output devices.
|
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
|
.. figure:: ../../main/images/sensor_pup.png
|
||||||
:width: 70 %
|
:width: 70 %
|
||||||
:target: pupdevice.html
|
: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
|
.. autoattribute:: pybricks.parameters.Side.RIGHT
|
||||||
:annotation:
|
: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**
|
**Move Hub**
|
||||||
|
|
||||||
.. figure:: ../../main/images/orientation_movehub_label.png
|
.. figure:: ../../main/images/orientation_movehub_label.png
|
||||||
|
|||||||
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
<!-- refer to https://keepachangelog.com/en/1.0.0/ for guidance -->
|
<!-- refer to https://keepachangelog.com/en/1.0.0/ for guidance -->
|
||||||
|
|
||||||
|
## 2.1.0 - 2021-12-16
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Updated docs to v3.1.0.
|
||||||
|
|
||||||
## 2.0.1 - 2021-11-19
|
## 2.0.1 - 2021-11-19
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pybricks/ide-docs",
|
"name": "@pybricks/ide-docs",
|
||||||
"version": "2.0.1",
|
"version": "2.1.0",
|
||||||
"description": "Special build of Pybricks API docs for embedding in an IDE.",
|
"description": "Special build of Pybricks API docs for embedding in an IDE.",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "pybricks"
|
name = "pybricks"
|
||||||
version = "3.1.0rc1"
|
version = "3.1.0"
|
||||||
description = "Documentation and user-API stubs for Pybricks MicroPython"
|
description = "Documentation and user-API stubs for Pybricks MicroPython"
|
||||||
authors = ["The Pybricks Authors <dev@pybricks.com>"]
|
authors = ["The Pybricks Authors <dev@pybricks.com>"]
|
||||||
maintainers = ["Laurens Valk <laurens@pybricks.com>", "David Lechner <david@pybricks.com>" ]
|
maintainers = ["Laurens Valk <laurens@pybricks.com>", "David Lechner <david@pybricks.com>" ]
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# SPDX-License-Identifier: MIT
|
# 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, Optional, Tuple, Union, overload
|
||||||
from typing import Collection, Iterable, List, 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
|
from .media.ev3dev import SoundFile
|
||||||
|
|
||||||
class DCMotor:
|
class DCMotor:
|
||||||
@@ -32,7 +32,6 @@ class Control:
|
|||||||
kp: Optional[int] = None,
|
kp: Optional[int] = None,
|
||||||
ki: Optional[int] = None,
|
ki: Optional[int] = None,
|
||||||
kd: Optional[int] = None,
|
kd: Optional[int] = None,
|
||||||
integral_range: Optional[int] = None,
|
|
||||||
integral_rate: Optional[int] = None,
|
integral_rate: Optional[int] = None,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
@overload
|
@overload
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
# Copyright (c) 2018-2020 The Pybricks Authors
|
# Copyright (c) 2018-2021 The Pybricks Authors
|
||||||
|
|
||||||
"""Robotics module for the Pybricks API."""
|
"""Robotics module for the Pybricks API."""
|
||||||
|
|
||||||
@@ -100,8 +100,9 @@ class DriveBase:
|
|||||||
"""Resets the estimated driven distance and angle to 0."""
|
"""Resets the estimated driven distance and angle to 0."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def settings(self, straight_speed, straight_acceleration, turn_rate,
|
def settings(
|
||||||
turn_acceleration):
|
self, straight_speed, straight_acceleration, turn_rate, turn_acceleration
|
||||||
|
):
|
||||||
"""Configures the speed and acceleration used
|
"""Configures the speed and acceleration used
|
||||||
by :meth:`.straight`, :meth:`.turn`, and :meth:`.curve`.
|
by :meth:`.straight`, :meth:`.turn`, and :meth:`.curve`.
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
# SPDX-License-Identifier: MIT
|
# 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 typing import Optional, Tuple, overload, Union
|
||||||
|
|
||||||
from ._common import Control, Motor
|
from ._common import Control, Motor
|
||||||
|
from .parameters import Stop
|
||||||
|
|
||||||
class DriveBase:
|
class DriveBase:
|
||||||
distance_control: Control
|
distance_control: Control
|
||||||
@@ -32,3 +34,6 @@ class DriveBase:
|
|||||||
) -> None: ...
|
) -> None: ...
|
||||||
def straight(self, distance: int) -> None: ...
|
def straight(self, distance: int) -> None: ...
|
||||||
def turn(self, angle: 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