Compare commits

...
Author SHA1 Message Date
David Lechner c77aedcd8a @pybricks/ide-docs v2.2.0 2022-06-02 10:44:03 -05:00
David Lechner 7b9209681c @pybricks/ide-docs v2.1.0 2022-06-02 10:40:55 -05:00
Laurens Valk 7de33c0ce5 v3.2.0b1 2022-06-02 17:10:46 +02:00
Laurens Valk dbc5d327e3 doc/common/conf: Display s^2 units correctly.
Now that we no longer use these in hyperlinks, we can use the right
unicode to display this unit correctly.
2022-05-30 17:29:30 +02:00
Laurens Valk 2e39740e4b pybricks.nxtdevices: Add typing. 2022-05-30 17:19:38 +02:00
Laurens Valk 45e0744b3f pybricks.ev3devices: Add typing. 2022-05-30 15:34:07 +02:00
Laurens Valk aab6c0d3e0 pybricks.media.ev3dev: Repair build.
Upon temporarily including these to update typing for pybricks.ev3devices, a lot of build errors were encountered.

Even though we won't be re-including these pages any time soon, we'll want to occasionally make sure that they still build with more recent versions of Sphinx.
2022-05-30 14:29:14 +02:00
Laurens Valk 8a4c4a5400 CONTRIBUTING: Add basic docstring guidelines.
Fixes https://github.com/pybricks/pybricks-api/issues/99
2022-05-30 10:57:31 +02:00
Laurens Valk ecfbc6ca75 CONTRIBUTING: Fix formatting and link to setup.
We don't have a wiki.
2022-05-30 10:21:34 +02:00
Laurens Valk c3b6d44c59 pybricks.geometry: Add typing. 2022-05-30 10:17:47 +02:00
Laurens Valk db71a80f36 pybricks.common.IMU: Add typing. 2022-05-30 10:03:44 +02:00
Laurens Valk a80d5cf91e pybricks.common.Accelerometer: Add typing.
Also remove tapped and shaken, which are not implemented.
2022-05-30 09:46:00 +02:00
Laurens Valk 515d261bad pybricks.common.Charger: Add typing. 2022-05-30 09:29:14 +02:00
Laurens Valk dd54d67720 pybricks.common: Use Number as input type where allowed. 2022-05-28 11:33:08 +02:00
Laurens Valk 453332201e pybricks.common.Battery: Add typing. 2022-05-28 11:23:21 +02:00
Laurens Valk 3548ff47ce pybricks.common.Keypad: Add typing. 2022-05-28 11:20:07 +02:00
Laurens Valk a02b283f3f pybricks.common.LightMatrix: Add typing. 2022-05-28 11:15:17 +02:00
Laurens Valk f197531979 pybricks.common.LightArray: Add typing.
Remove blink and animate, which aren't implemented. These weren't displayed in the docs, so this is not a real change; it just makes typing more correct.
2022-05-28 10:55:40 +02:00
Laurens Valk 2167b9d52d pybricks.common.ColorLight: Add typing.
Also remove pybricks.common.Light which isn't used anywhere.

pupdevices.Light is a standalone light that does not support animations or blinks, so don't inherit from this nonexistent class.

Also remove the ColorLight.reset() method which was never implemented.
2022-05-27 20:00:28 +02:00
Laurens Valk 2be15fdf4d pybricks.common.Speaker: Add typing. 2022-05-27 19:14:22 +02:00
Laurens Valk aaf3ad1b9c pybricks.common.Control: Add typing. 2022-05-27 17:15:24 +02:00
Laurens Valk bd7806d2d4 all: Format with black.
Also activate auto formatting. Bump flake8 and mark black
disagreements in setup.cfg.
2022-05-27 16:22:05 +02:00
Laurens Valk 24f7d7c288 pybricks.common.Motor: Add typing. 2022-05-27 16:01:18 +02:00
Laurens Valk 5e0ba1de07 doc/common/conf: Format units in return type.
This formats return types so they don't look like tuples:

int: deg

If we can figure out how these nodes work, we can create proper links
and maybe use italics for the units or a slightly different font color.
2022-05-27 14:59:32 +02:00
Laurens Valk 2f8ba40034 poetry: Patch Sphinx to use docstring signatures when given.
This is the intended behavior everywhere, but it wasn't working for overloaded functions and methods.

See https://github.com/pybricks/sphinx/commit/f57417c042cbf4a72448518b7599517495cc6fde
2022-05-27 12:21:45 +02:00
Laurens Valk c4a09ab62a pybricks.common.DCMotor: Add typing. 2022-05-09 15:05:09 +02:00
Laurens Valk c0c53db5ee pybricks.common.System: Add typing. 2022-05-09 10:41:39 +02:00
Laurens Valk 5e09a6f1bd .vscode/settings: Add rewrap setting.
Now we can press Alt+Q to hard (re)wrap comments and docstrings.
2022-05-09 10:28:39 +02:00
Laurens Valk 5e9a8c5737 doc/main/signaltypes: Change how units are documented.
Previously, arguments had "types" like ":ref:`speed`", which would be rendered by Sphinx as a hyperlink and displayed as "rotational speed: deg/s".

This worked well enough but it had a few shortcomings:
- It looks bad on autocomplete, which doesn't know how to render RST with cross references.
- No real type information: int, float, ... ?
- Some units are very long, making the docs less concise.
- The unified approach doesn't always work. Some method arguments can be either deg/s or mm/s, depending on the application. This gets even lengthier.
- It's hard to maintain if you don't know what to link to.

In the new approach, the unit is just added to the type as plain text. Instead of giving the physical signal name, we give the real data type, which is more standard. The physical signal name is usually apparent from the docstring anyway, and can be inferred from the unit as well. This also solves all of the above problems.

Since most Pybricks methods allow both int and float for numeric inputs, we document these as a Number type, which is the union of int and float. Since the type is no longer directly tied to the type, we can still document the return type correctly, since this is never a union.

Instead of having complicated hacks in Sphinx to make this work (I have tried many), it turns out we can conveniently suppress broken references and still display the units. The only downside is that units will no longer have hyperlinks to the signal pages, at least for the moment. We should be able to make on_missing_reference a bit smarter to format the units as we see fit if needed.

The approach here is exemplified in the Motor.run_until_stalled method. Subsequent commits will apply it everywhere. Also clarify the behavior for duty_limit=None while we are updating this code anyway.
2022-05-09 10:28:31 +02:00
Laurens Valk f934fdd9bd pybricks.common.IMU: Change example to print G force.
Since we changed the acceleration units to mm/s/s, the output values are
fairly large.

The Matrix repr function prints values up to 999, so this avoids
truncating the output.

It is also a good demo of scalar division for a Matrix / Vector.
2022-04-01 16:32:39 +02:00
Laurens Valk 556728937f pybricks.common.Accelerometer: Use mm/s/s units.
Fixes https://github.com/pybricks/pybricks-api/issues/94

For Move Hub, this is a breaking change since Move Hub IMU support
was already released. For the other hubs, the IMU API has not been
released yet, so we can do this silently.
2022-04-01 15:41:15 +02:00
Laurens Valk 813ea61308 doc/main/conf.py: Show beta features on RTD/latest. 2022-04-01 14:51:38 +02:00
Laurens Valk 2e8e43bcdf rtd-requirements: Upgrade to Sphinx 4.4.0. 2022-04-01 14:31:35 +02:00
Laurens Valk e4ddd1ffce pybricks.geometry.Axis: Drop ANY.
This was previously dropped in a2583944d9
but it was added in again in c666009511.

Since this module was never included in a release (it was hidden),
it is OK to do this.
2022-04-01 14:28:38 +02:00
Laurens Valk 243f2948ef pybricks.hubs.primehub: Show in beta version.
Make it show up in the beta build and hide it in the release build.
2022-04-01 14:28:31 +02:00
Laurens Valk 81a1379781 doc/Makefile: Allow BETA=1 to include beta features.
Prior to every previous release, we we had to delete certain
features that did not make it into the release. This lets us
do that with a tag instead. This way we can keep a clean git
history that is easier to follow.
2022-04-01 13:39:04 +02:00
Laurens Valk 93a9370790 doc/common/extensions: Hide version directives in IDE build.
Version tags can be useful to keep track of new or updated features.

This lets us hide such details in the documentation that ships with the IDE to keep it concise.
2022-04-01 09:38:41 +02:00
Laurens Valk 1989561c90 .github/workflows: Fix typo in build name. 2022-03-22 15:49:23 +01:00
Laurens Valk 4101f9be79 poetry: Update Sphinx and RTD-theme.
We were not using a proper release for sphinx-rtd-theme
in order to work around some bugs. Meanwhile, a proper
release has come out, so let's upgrade to 1.0.0.

Also bump Sphinx to 4.4.

Also update and fix workarounds for cross references.
Fixes https://github.com/pybricks/pybricks-api/issues/98.
2022-03-22 15:38:04 +01:00
Laurens Valk 0a31bc711f pybricks.common.Control: Add deceleration setter.
Fixes https://github.com/pybricks/pybricks-api/issues/97
2022-03-21 11:17:34 +01:00
Pavel Lobodinský d8bd890101 pybricks.common: Charger, IMU and System auto-completion 2022-03-02 10:31:53 -06:00
David Lechner 2ba7edab0c pybricks.ev3/pupdevices: fix Motor code completion
The Microsoft Python extension for VS code doesn't include imports in
type hints, so the Motor type wasn't working properly. We can fix this
by wrapping the import type in a new, empty class definition.

The DCMotor class was also missing from ev3devices and the typing for
the overloaded reset_angle method in pupdevices was missing. These are
fixed as well.
2022-02-21 10:59:00 -06:00
Pavel Lobodinský 616051149b pybricks.common.Speaker: Add volume setter. 2022-01-20 08:56:29 +01:00
Laurens Valk e69c422f83 pybricks.common.Motor: Add absolute value example.
Fixes https://github.com/pybricks/support/issues/611
2022-01-20 08:39:43 +01:00
Laurens Valk 0ceabe8497 pybricks.common.Charger: Document it. 2022-01-14 15:14:28 +01:00
Laurens Valk d3ae4ec9ee pybricks.pupdevices.ColorSensor: Move cleanup example.
The color sensor light is much brighter, so having an example
to turn it off is a bit more useful.

Fixes https://github.com/pybricks/pybricks-api/pull/90
2022-01-07 14:11:03 +01:00
Laurens Valk ffb2f8aa96 pybricks.pupdevices.UltrasonicSensor: Move cleanup example.
Also generalize the example so that it can be used on all hubs.
2022-01-07 13:38:07 +01:00
Pavel Lobodinský 65c81834c9 pybricks.hubs.PrimeHub: Added a cleanup example. 2022-01-07 13:38:07 +01:00
Pavel Lobodinský 97002948d1 pybricks.common: Refactored Speaker API to be hub specific.
The Prime/Inventor Hub Speaker allows only a subset of EV3 Speaker API. Hence, splitting the API up.
2022-01-05 12:10:11 -06:00
Pavel Lobodinský 70aa5ee0e2 pybricks._common: Renamed incorrect argument name, fixed tuple type. 2022-01-03 11:01:33 +01:00
Pavel Lobodinský efc1650e7f pybricks.parameters: Added Icon class, added missing methods and attributes.
Added missing Icon class present in the firmware
2022-01-03 11:01:33 +01:00
Pavel Lobodinský fe60636072 pybricks.geometry: Fixed Matrix incorrect rows type, added missing methods. 2022-01-03 11:01:33 +01:00
Pavel Lobodinský a1342f77c9 pybricks.hubs: Default values for the PrimeHub. 2022-01-03 11:01:33 +01:00
Laurens Valk d806fe9fbe pybricks.common.Control: Fix docstring and type hints for limits().
Fixes https://github.com/pybricks/support/issues/565
2021-12-30 09:12:27 +01:00
David Lechner 1259d5d33a bump version for development 2021-12-16 15:36:52 -06:00
David Lechner 098b8eb9cb v3.1.0 2021-12-16 15:36:14 -06:00
David Lechner c666009511 pybricks.geometry: add Axis.ANY
This exists in the firmware but was missing here.
2021-12-16 15:08:50 -06:00
David Lechner 7f4234fc1e pybricks._common: remove type hint for integral_range()
This was removed in e061617.

Also fix import of Axis while we are touching this file.
2021-12-16 15:07:33 -06:00
David Lechner 482289c384 pybricks.robotics: add type hint for curve()
This method was added in 30803fc.
2021-12-16 15:06:00 -06:00
Laurens Valk 30803fc017 pybricks.robotics.DriveBase: Add curve method.
This generalizes motion to curves (arcs), which is in
between straight lines and in-place turns.
2021-12-01 15:38:27 +01:00
Laurens Valk 749eceefc4 pybricks.robotics.DriveBase: Document then and wait arguments. 2021-12-01 15:35:37 +01:00
Laurens Valk 57f6f0fbef pybricks.pupdevices.DCMotor: Document settings method.
Also update changelog for recent changes.
2021-12-01 14:55:34 +01:00
Laurens Valk e061617c34 pybricks.common.Control: Drop integral_range.
This setting is no longer used. We leave a placeholder setting so we don't break existing programs.

See https://github.com/pybricks/pybricks-micropython/commit/e82dd6a2be4e378ab0b1ee7e3b2643fe654de4a9#diff-e529f43c94cf766ade4b68930f9713a45b62618f4305e4c0c88ba872e9f9cd0e
2021-12-01 14:54:21 +01:00
Laurens Valk eb09ecd7c7 pybricks.common.Control: Drop duty limit.
This is now a per-motor voltage limit.

See https://github.com/pybricks/support/issues/536
2021-12-01 14:41:09 +01:00
Laurens Valk 06a1542613 pybricks.pupdevices.DCMotor: Document settings method.
See https://github.com/pybricks/support/issues/536
2021-12-01 14:40:06 +01:00
Laurens Valk 82a8f2ae89 pybricks.pupdevices.Motor: Add small motor render.
Fixes https://github.com/pybricks/support/issues/441
2021-11-23 08:59:44 +01:00
Laurens Valk 7d0fe9cb85 doc/common/extensions: Fix classlink.
Allow the link to be different from the name.

This lets us fix the link for the Inventor Hub, which was linking to a non-existent page.
2021-11-22 14:49:20 +01:00
Laurens Valk 1af876ac8f pybricks.pupdevices.ColorLightMatrix: Fix render.
- Use isometric projection
- Fix broken plug
- Use correct background color

While we are at it, add colors to show which 9 colors this device supports.
2021-11-22 14:49:20 +01:00
David Lechner 718a28c0da @pybricks/ide-docs v2.0.1 2021-11-19 20:30:11 -06:00
David Lechner a2a375cb5c docs/pupdevices: fix broken link
The link to the color light matrix page was broken due to an invalid
file name.
2021-11-19 20:28:33 -06:00
David Lechner 466d8d6c86 @pybricks/ide-docs v2.0.0 2021-11-19 19:59:19 -06:00
David Lechner e77b3dcf4d v3.1.0rc1 2021-11-19 19:42:07 -06:00
David Lechner b6d1eef2a1 pybricks.iodevices.LWP3Device: add api and docs
This adds docs and API stubs for pybricks.iodevices.LWP3Device.

Fixes: https://github.com/pybricks/support/issues/534
2021-11-19 19:31:53 -06:00
David Lechner 20cb5fdde5 doc: make all titles sentence case
This makes the casing of titles consistent throughout the docs.

Fixes: https://github.com/pybricks/pybricks-api/issues/75
2021-11-19 19:30:57 -06:00
David Lechner 2f574e8c03 pybricks.pupdevices.ColorLightMatrix: add api and docs
This adds the SPIKE 3x3 Color Light Matrix to the API and docs.
2021-11-19 19:30:57 -06:00
David Lechner 9d8531a85b npm/ide-docs: move npm packaging to separate directory
This makes a clean separation between the packaging and the docs.
2021-11-19 19:30:57 -06:00
David Lechner fee122cf33 CHANGELOG: move to top level
This makes the CHANGELOG easy to find.
2021-11-19 16:37:38 -06:00
David Lechner f42ed06d4f doc/main/CHANGELOG: use keepachangelog.com recommendations
This updates the changelog to use keepachangelog.com recommendations
to make it consistent with other Pybricks changelogs.
2021-08-30 13:29:38 -05:00
David Lechner a8126f0bed doc/main: fix dir in package.json
Another case of a missed ide to main directory.
2021-08-30 12:20:44 -05:00
David Lechner 2c4685f594 doc/main: add TAG make option
This splits the Sphinx tag option from SPHINXOPTS. This allows us to
specify the tag without having to remember to add -W and -t. It also
fixes not being able to specify the tag with make.bat on Windows.

While we are touching this, redundant SOURCEDIR uses are removed (main
is already the default) and the .github/workflows/publish-ide-docs.yml
script is fixed (ide directory no longer exists).
2021-08-30 12:14:34 -05:00
David Lechner 8b0f98d25b @pybricks/ide-docs v1.6.0 2021-08-30 11:12:05 -05:00
Laurens Valk dd2e6e8603 ubuiltins.int: Document from_bytes manually.
Sphinx fails to show the docsting for class methods. Since we have very few of them, it is easier to just document this one manually

Fixes https://github.com/pybricks/pybricks-api/issues/86
2021-08-22 12:15:42 +02:00
Laurens Valk a0f4818e26 ubuiltins.int: Document it. 2021-08-06 14:59:45 +02:00
Laurens Valk af23c10566 ubuiltins.float: Document it.
Override typed docstrings in order to hide types like SupportsFloat.
2021-08-06 14:58:19 +02:00
Laurens Valk d7096dad80 ubuiltins.complex: Document it.
Override typed docstrings in order to hide types like SupportsFloat and SupportsComplex.

Avoid use of ``real`` and ``imag``, since both ``a`` and ``b`` can be
either.

Also reduce number of overloads by letting ``b`` default to 0, which is true in practice.

See also https://github.com/pybricks/pybricks-api/issues/84
2021-08-06 14:25:00 +02:00
Laurens Valk 1d2b1f0307 rtd-requirements: Update to Sphinx 4.1
See https://github.com/pybricks/pybricks-api/issues/70
2021-08-06 10:47:14 +02:00
Laurens Valk 9945b43713 pyproject: Update to Sphinx 4.1.
Also bump to a development version of sphinx-rtd-theme that supports Sphinx 4.

Fixes https://github.com/pybricks/pybricks-api/issues/70
2021-08-06 10:40:26 +02:00
Laurens Valk 4124e1dd4e doc/common/conf: Drop unused imports.
These prevent us from upgrading Sphinx and they aren't being used anyway.

Fixes e4c7e5abeb
2021-08-06 10:07:42 +02:00
Laurens Valk d86b5584fb ubuiltins: Type enumerate as a class.
This reverts commit a0ea0d8ca0 because of https://github.com/pybricks/pybricks-api/issues/72
2021-08-06 09:51:52 +02:00
Laurens Valk 1c01e981e0 usys: Clean up.
Add requirements, drop autodoc, and add a few cross references.
2021-08-05 16:13:50 +02:00
Laurens Valk 8a6ddf677c pybricks.pupdevices.Remote: Light examples. 2021-08-05 14:56:00 +02:00
Laurens Valk 5d4481dbb0 pybricks.pupdevices.ColorDistanceSensor: Drop duplicate example. 2021-08-05 13:45:57 +02:00
Laurens Valk 786770cff2 ubuiltins.bool: Use arguments.
https://github.com/pybricks/pybricks-api/issues/82
2021-08-05 12:49:44 +02:00
Laurens Valk 572b573d2f ubuiltins: Fix _type typos.
This was accidentally introduced via https://github.com/pybricks/pybricks-api/issues/71 by replacing too many things automatically.
2021-08-05 12:33:00 +02:00
Laurens Valk 15bd870140 ubuiltins: Use argument layout.
https://github.com/pybricks/pybricks-api/issues/82
2021-08-05 12:32:56 +02:00
Laurens Valk b101d1992d ubuiltins.print: Use English. 2021-08-05 12:32:51 +02:00
Laurens Valk b013204f88 ubuiltins.input: Say what it does.
The docstring said something about an argument, but not what this function is for.
2021-08-05 12:32:47 +02:00
Laurens Valk b3c5353dd6 ubuiltins: Reorganize page.
Fixes https://github.com/pybricks/pybricks-api/issues/80
2021-08-05 12:32:41 +02:00
Laurens Valk 0ecf536cda ubuiltins: Add compatibility everywhere.
This lets us sort everything by category or alphabetically without having to make special categories for Move Hub.
2021-08-05 12:32:37 +02:00
David Lechner f2124615ba ubuiltins: List decorators in separate section.
This moves the built-in decorators to their own section and uses
`autodecorator` to indicate they are decorators.
2021-08-05 12:32:29 +02:00
Laurens Valk 49ade9d9c6 pybricks.robotics: Show compatibility. 2021-08-05 12:32:03 +02:00
Laurens Valk 045312921e pybricks.geometry: Show compatibility. 2021-08-05 12:32:03 +02:00
Laurens Valk 39f58b9e03 pybricks.tools: Show compatibility. 2021-08-05 12:32:03 +02:00
Laurens Valk a0467b8d8e doc/common/requirements: Fix image paths.
This ensures that the requirements directive works regardless of the depth of the document in the tree.
2021-08-05 12:32:03 +02:00
Laurens Valk 4945156d9a pybricks.parameters: Show compatibility. 2021-08-05 12:32:03 +02:00
Laurens Valk 97b2de46ac pybricks.hubs: Show compatibility. 2021-08-05 12:32:03 +02:00
Laurens Valk e8d7281626 doc/common/requirements: A hub supports itself.
This way we can do the following, which is useful if it cannot be expressed in terms of other requirements.

.. pybricks-requirements:: movehub

A good example is on the specific hub page itself. The Move Hub requires the Move Hub.
2021-08-05 12:32:03 +02:00
Laurens Valk 979da8b170 pybricks.pupdevices: Show compatibility. 2021-08-05 12:32:03 +02:00
Laurens Valk ac4a913be3 doc/common/requirements: Toggle hub table.
This makes it possible to hide/unhide the compatibility table.

It is adapted from the sphinxcontrib-contentui extension: https://github.com/ulrobix/sphinxcontrib-contentui
2021-08-05 12:32:03 +02:00
Laurens Valk 31a30f380f doc/common/requirements: Rename to static.
We will work on a version that can be toggled dynamically. It will just include this static version. This keeps things simple and still lets
us use the static version as needed.
2021-08-05 12:32:03 +02:00
Laurens Valk 87dacfbf76 doc/common/extensions/requirements: Allow none.
With no requirements imposed, this means all hubs will work.
2021-08-05 12:32:03 +02:00
Laurens Valk b02895e5fc ubuiltins: Use raw strings for inline math.
This resolves the following warnings:
./src/ubuiltins/__init__.py:143:31: W605 invalid escape sequence '\l'
./src/ubuiltins/__init__.py:143:38: W605 invalid escape sequence '\l'
./src/ubuiltins/__init__.py:174:31: W605 invalid escape sequence '\l'
./src/ubuiltins/__init__.py:174:38: W605 invalid escape sequence '\l'
2021-08-05 12:32:21 +02:00
Laurens Valk 486ac60ea0 ubuiltins.bool: Clarify docs.
Avoid double and triple negatives.
2021-08-05 12:32:17 +02:00
Laurens Valk a3b6507a15 ubuiltins.bytes: Clarify docs. 2021-08-05 12:32:14 +02:00
Laurens Valk 75bc15f071 ubuiltins: Add bytearray. 2021-08-05 12:32:03 +02:00
Laurens Valk 0b9280a8df uerrno: Display on separate page.
Fixes https://github.com/pybricks/pybricks-api/issues/78
2021-08-02 11:01:20 +02:00
David Lechner 677656f669 pybricks.robotics.DriveBase: Fix arg name in type hints.
This fixes the `speed` arg name in the `DriveBase.drive()` method in the type hint file. Fixes #76.
2021-07-30 15:27:09 -05:00
Laurens Valk a8ab8b2314 pybricks.pupdevices.Motor: Add reset_angle kwarg.
Documents https://github.com/pybricks/support/issues/389
2021-07-28 16:07:53 +02:00
Laurens Valk 62bb262b96 pybricks.pupdevices.Remote: Add more examples. 2021-07-28 14:50:43 +02:00
Laurens Valk 8463206f8e pybricks.pupdevices.Remote: Add name().
https://github.com/pybricks/support/issues/404
2021-07-28 13:41:00 +02:00
Laurens Valk 1cf6f8d31b pybricks.iodevices: Document availability. 2021-07-27 15:55:38 +02:00
Laurens Valk a0bd4a6812 doc/common/extensions: Show compatibility on hub.
This simplifies the table and reduces its size.

Also copy assets manually since Sphinx does not automatically copy
images to _images when used for custom directives.
2021-07-27 15:43:13 +02:00
Laurens Valk efc907fb0c doc/main: Add hub compatibility icons.
Also render to git tree.
2021-07-27 14:56:11 +02:00
Laurens Valk be0903de9e doc/common/extensions: Basic styling.
Turns it into a table with images, using builtin RTD classes for CSS.
2021-07-26 15:47:02 +02:00
Laurens Valk 20361971da doc/main/images: Crop City Hub.
This hub had extra whitespace so they were all the same height, but this is no longer needed in the current layout.
2021-07-26 15:03:42 +02:00
Laurens Valk cefa78270a doc/common/extensions: Add requirements directive.
Displays compatibility for each hub depending on its features.
2021-07-26 12:18:55 +02:00
Laurens Valk 1f5eb1790b doc/main/package: Reenable warnings as errors.
This gets disabled when overriding SPHINXOPTS.
2021-07-23 15:59:33 +02:00
Laurens Valk 84335d0032 doc/make: Build main doc target by default.
Less typing is better.
2021-07-23 15:46:58 +02:00
Laurens Valk cb74f8e302 doc/main: Move signals to Pybricks TOC.
This was the only remaining section under "extras", so it is better to have it elsewhere. Since it only applies to the Pybricks package, put it there.

Also rename Pybricks Modules heading to Pybricks Package, since it behaves more like a package in contrast with the MicroPython modules that we now document as well.
2021-07-23 15:38:05 +02:00
Laurens Valk 78bd21b197 pybricks.common.Control: Drop feed_forward.
The implementation no longer includes this, so it is removed from the docs as well.

Fixes https://github.com/pybricks/pybricks-api/issues/74
2021-07-23 15:35:13 +02:00
Laurens Valk 24bba6d24c pybricks.pupdevices.Motor: Document control here.
Based on user feedback, we learned that the control attribute is used more frequently than anticipated. Therefore it makes sense to document it here, just like we do with instances of pybricks.common classes in hubs.

This makes it a bit easier to find and see how it is used, along with some of the existing examples.
2021-07-23 15:33:18 +02:00
Laurens Valk 0edddbb0c2 pybricks.common.Control: Fix scale doc.
Document it as an attribute instead of in the main docstring. This way we can choose where it shows up in the docs.
2021-07-23 14:51:21 +02:00
Laurens Valk a11af0845b doc/main/motors: Drop commented sections.
This is not going to be completed here in the API docs.
2021-07-23 14:37:28 +02:00
Laurens Valk 3b71bce0b0 doc/main: Build IDE docs from main docs.
With EV3 dropped from the 3.X documentation, the main docs are now nearly identical to the IDE docs, save for some layout changes.

Having just one set of docs is easier to maintain. This drops the IDE doc target.
2021-07-23 12:56:33 +02:00
Laurens Valk 434ff5e346 doc/common/conf: Keep IDE conf settings.
We are going to be deleting the ide build files, so make sure we keep what's needed.
2021-07-23 12:45:30 +02:00
Laurens Valk f7239fc9a9 pybricks.parameters.Port: Drop EV3 sensor ports.
We can restore these if the docs cover EV3 once more.
2021-07-23 12:35:46 +02:00
Laurens Valk 7e13611bc5 doc/common/conf: Default to main on RTD.
It would be nicer to specify this in the .readthedocs.yaml file, but this appears to not to be supported.
2021-07-23 12:34:10 +02:00
Laurens Valk 78feab8949 pybricks.tools: Drop Datalog class from doc.
We can unhide this if/when we support this on Powered Up.
2021-07-23 11:35:32 +02:00
Laurens Valk f692e5a127 pybricks.iodevices: Drop EV3 specific devices.
Some of these could be brought back if we add Powered Up support.
2021-07-23 11:32:01 +02:00
Laurens Valk fbd843cb54 doc/main/index: Unify IDE and main build.
The `only` directive can be used to include content selectively. It cannot be used to select a different TOC, which is why we resorted to separate doc builds before.

Now that we have dropped EV3 references from the docs, we can use a single build and just customize the content on the landing page with the only directive.

The docs can now be built with:

# Main docs:
make -C doc html SPHINXOPTS=-tmain

# IDE docs:
make -C doc html SPHINXOPTS=-tide
2021-07-23 11:25:51 +02:00
Laurens Valk e4c7e5abeb doc/common/conf: Drop class method hack.
This can be traced back to 0013a74d72 and 92e3735d63.

It was used to work around things like

sound.beeps(number)
   Description

being incorrectly displayed as

classmethod sound.beeps(number)
   Description

But the current version of sphinx appears to display this correctly even without the hack. We want to reduce the number of hacks because they tend to break updates (https://github.com/pybricks/pybricks-api/issues/69#issuecomment-879822417).
2021-07-23 11:04:03 +02:00
Laurens Valk 8d521c1b1f doc/common/conf: Drop EV3 hack.
This is no longer required, perhaps not even for EV3. For example, PrimeHub.speaker looks as intended.

We want to reduce the number of hacks because they tend to break updates (https://github.com/pybricks/pybricks-api/issues/69#issuecomment-879822417).
2021-07-23 10:48:07 +02:00
Laurens Valk 1be7fce116 doc/main: Drop EV3 references.
To make the documentation easier to use and maintain, EV3 content will be hidden.

The stable 2.0 docs should be used for EV3 instead.
2021-07-23 10:41:34 +02:00
Laurens Valk 5ab81dc732 doc/main: Update landing page with link to EV3. 2021-07-21 19:27:45 +02:00
Laurens Valk 72e0d87f77 ubuiltins: Examples for common exceptions. 2021-07-21 14:53:56 +02:00
Laurens Valk 923e8caf84 ubuiltins: Organize exceptions. 2021-07-21 11:12:51 +02:00
Laurens Valk e8d47ffca1 uerrno: Document alongside OSError.
These are meant to be used together, so document them in the same place along with a practical example.
2021-07-19 15:03:10 +02:00
Laurens Valk 2c32d093d0 ubuiltins.bytes: Clarify range up to 255.
Be consistent and use <= for both. A bit more intuitive because the number 256 cannot be used in bytes objects.
2021-07-16 16:12:43 +02:00
Laurens Valk ba6d7ac3f5 ubuiltins: Fix unwanted ubuiltins prefix.
Fixes https://github.com/pybricks/pybricks-api/issues/71.
2021-07-16 16:07:55 +02:00
Laurens Valk 64ea5e341c ubuiltins: Sort classes and functions by use case. 2021-07-16 16:07:55 +02:00
Laurens Valk a0ea0d8ca0 ubuiltins: Document enumerate as a function.
Though it is technically its own type in MicroPython, this change follows the CPython documentation. Essentially this just drops the class prefix and leaves everything else unchanged.

This makes more sense when organizing this module by classes and functions. It's also a bit more logical since the equivalent example we provoide is a function definition, not a class definition.
2021-07-16 16:07:55 +02:00
Laurens Valk 29404babcf ubuiltins: Split out automodule.
List all functions and classes explicitly so we can organize them by category in later commits.

Also split out exceptions and uerrno to dedicated page because the builtins page was getting very long and hard to navigate.
2021-07-16 16:07:46 +02:00
Laurens Valk 3b1fd091f1 micropython: Add examples for memory stats. 2021-07-14 16:08:52 +02:00
Laurens Valk cd7d5be748 micropython.stack_info: Clean up docstring.
Reword to say how it useful, not how it is not useful.

Also fix return type.
2021-07-14 15:36:18 +02:00
Laurens Valk 97e368312e micropython.qstr_info: Clean up docstring.
Say the same with less words. Also add one line from elsewhere in the MicroPython docs to explain what this is about.
2021-07-14 15:32:28 +02:00
Laurens Valk 28af77fcfc micropython.mem_info: Clean up docstring.
Say the same with less words.
2021-07-14 15:31:41 +02:00
Laurens Valk 3ed6e2dd7d micropython.opt_level: Clarify docstring.
Just list what each level does instead of a complicated if-then bullet list. It's still shorter anyway.

Also add a note that this only applies to REPL code in case of Pybricks.
2021-07-14 15:13:26 +02:00
Laurens Valk 4c00c3209b micropython.const: Improve docstring, add example.
This merges the useful information from two different places:
- The original docstring for const.
- Writing MicroPython code for constrained devices.

Also reduce type to just int, because only ints are supported.
2021-07-14 14:48:59 +02:00
Laurens Valk c656eae2f3 micropython: Drop TConst type.
TConst does not exist, so adding it makes it a bit harder to read than needed. The const() "function" will take int or float, and the return value can be used as such, even if it is optimized out. This is described in the docstring, so we can leave out the additional type.

Also adds autofunctions in place of one auto module so we can move things around as needed. Also fix cross links with usys to get the build to pass before we update that module.
2021-07-14 14:13:18 +02:00
Laurens Valk 456dc28c1b .readthedocs: Add configuration file.
When this file is present, the settings in the online dashboard will be ignored.

This lets us explicitly set the Python version, in this case to 3.8 to match pyproject.toml.

Fixes https://github.com/pybricks/pybricks-api/issues/68.
2021-07-14 13:06:30 +02:00
Laurens Valk 238204d280 doc/main: Rename from doc/api.
The doc/api is a legacy name, which is confusing in the current use, since all build targets are now APIs.

Today we have:

doc/common: Common configuration and settings between all targets.

doc/main: Main Pybricks documentation at docs.pybricks.com.

doc/ide: Documentation shipped with the Pybricks Code IDE.
2021-07-14 11:39:20 +02:00
Laurens Valk 55aec445b1 CONTRIBUTING: Update commit message guidelines. 2021-07-14 11:39:20 +02:00
Laurens Valk 7f622927ff CHANGELOG: Add recent changes. 2021-07-14 11:39:20 +02:00
Laurens Valk 8384a10c2d doc/ide/index: Enable MicroPython modules. 2021-07-14 11:39:20 +02:00
Laurens Valk 619fa0c968 doc/main: Group MicroPython rst files.
They are easier to find when they are not mixed with Pybricks docs.
2021-07-14 11:39:25 +02:00
Laurens Valk 1fab46e67f doc/main/index: Clean up menu and builtins.
There is no ubuiltins module, so we shouldn't mention it.

Also reduce size of other module titles so they fit on one line in the
menu. This makes it easier to read and get an overview.
2021-07-14 11:39:20 +02:00
Laurens Valk 727ec3fe46 umath: Redo module docs.
This reworks the documentation for the umath module, as done previously as per https://github.com/pybricks/pybricks-api/pull/64 and https://github.com/pybricks/pybricks-api/issues/63

The presentation and docstrings are inspired by the Python 3 math module documentation instead of the MicroPython math module documentation. Functions are grouped roughly by use case.
2021-07-14 11:22:04 +02:00
Laurens Valk a0e4ffdb5c umath: Use umath for math.
Do this for all Powered Up examples.
2021-07-14 11:22:04 +02:00
Laurens Valk 9b8a66e3da pybricks.hubs.PrimeHub: Add system examples. 2021-07-14 09:43:34 +02:00
Laurens Valk 9944cf3adf pybricks.common.System: Add name() getter. 2021-07-14 09:43:20 +02:00
David Lechner 286079fe68 ubuiltins: add stubs and docs for ubuiltins module
Issue: https://github.com/pybricks/support/issues/236
2021-07-14 09:41:30 +02:00
David Lechner d492b04402 umath: add stubs and docs for umath module
Issue: https://github.com/pybricks/support/issues/236
2021-07-14 09:41:30 +02:00
David Lechner 818409f675 usys: add stubs and docs for usys module
Issue: https://github.com/pybricks/support/issues/236
2021-07-14 09:41:30 +02:00
David Lechner 9dd131142e uselect: add stubs and docs for uselect module
Issue: https://github.com/pybricks/support/issues/236
2021-07-14 09:41:30 +02:00
David Lechner f828d11f40 urandom: add stubs and docs for urandom module
Issue: https://github.com/pybricks/support/issues/236
2021-07-14 09:41:30 +02:00
David Lechner 532639b820 uio: add stubs and docs for uio module
Issue: https://github.com/pybricks/support/issues/236
2021-07-14 09:41:30 +02:00
David Lechner 0865a58632 uerrno: add uerrno module stubs and docs
Issue: https://github.com/pybricks/support/issues/236
2021-07-14 09:41:30 +02:00
David Lechner 0eb0e160e9 micropython: Add stubs and docs for micropython module
Issue: https://github.com/pybricks/support/issues/236
2021-07-14 09:41:30 +02:00
David Lechner 7126431f9f pybricks: move into src/ directory
Moving the pybricks package into a src/ directory so that we can add
additional packages without polluting the top-level directory.
2021-07-14 09:41:30 +02:00
Laurens Valk 5a8baeff4c pybricks.hubs: Add system examples. 2021-07-07 09:58:51 +02:00
Laurens Valk a2801aff41 pybricks.hubs: Enable single button. 2021-07-07 09:47:28 +02:00
Laurens Valk 76432120c4 pybricks.common.System: Add shutdown method.
Also drop reset() and update reset_reason() after https://github.com/pybricks/support/issues/379
2021-07-07 09:47:35 +02:00
Laurens Valk 3ce741ac2b pybricks.common.System: Add initial documentation. 2021-07-07 09:47:28 +02:00
Laurens Valk ce1456cb92 @pybricks/ide-docs v1.5.0 2021-07-01 15:56:32 +02:00
Laurens Valk f8cd3451ea pupdevices.Remote: Enable it.
Also add an example.
2021-06-30 17:14:25 +02:00
Laurens Valk cb84ca87c6 @pybricks/ide-docs v1.4.0 2021-06-23 19:56:31 +02:00
Laurens Valk e1995f9d1b ide: Display note about beta version. 2021-06-23 19:50:51 +02:00
Laurens Valk 7f0b1489a2 ide: Re-enable 3.X features.
These were hidden for the 3.0 release, but we can re-enable them for
the beta release of 3.1.

Revert "v3: Drop parameters Side and Button."

This reverts commit 07c53e9a3d.

Revert "v3: Drop Remote control."

This reverts commit b600f5029e.

Revert "v3: Drop geometry module."

This reverts commit 5f767f3fee.

Revert "v3: Drop Prime Hub and Inventor Hub."

This reverts commit 8db7892f8c.

Revert "v3: Drop IMU documentation."

This reverts commit b325bf4bff.
2021-06-23 19:41:15 +02:00
Laurens Valk aa2019be02 @pybricks/ide-docs v1.3.3 2021-06-23 19:36:00 +02:00
Laurens Valk 1ac78b5b82 @pybricks/ide-docs v1.3.2 2021-06-23 19:35:59 +02:00
Laurens Valk 847a3d5eec @pybricks/ide-docs v1.3.1 2021-06-23 19:35:59 +02:00
Laurens Valk 1a208ddd25 @pybricks/ide-docs v1.3.0 2021-06-23 19:35:59 +02:00
Laurens Valk 07c53e9a3d v3: Drop parameters Side and Button. 2021-06-23 19:35:58 +02:00
Laurens Valk b600f5029e v3: Drop Remote control. 2021-06-23 19:35:58 +02:00
Laurens Valk 5f767f3fee v3: Drop geometry module. 2021-06-23 19:35:57 +02:00
Laurens Valk 8db7892f8c v3: Drop Prime Hub and Inventor Hub. 2021-06-23 19:35:57 +02:00
Laurens Valk b325bf4bff v3: Drop IMU documentation.
This is not officially supported yet, so drop from release docs.
2021-06-23 19:35:57 +02:00
David Lechner 5d355e9892 doc/api/media: fix audio playback
Sphinx changed how filenames are generated which broke media playback.
The file name now includes the MD5 hash of the filename passed to the
:download: directive.

This was done with the following script:

    for f in $(find media/ev3dev-media/ -name "*.wav" -exec bash -c 'echo "$(echo -n ../../'{}' | md5sum)/$(basename '{}')"' \;); do
        sed -i "s,_downloads/$(basename $f),_downloads/$f," doc/api/media.rst;
    done
2021-06-04 12:45:44 -05:00
Laurens Valk 3b20a811cb examples/pup/motor_dc: Add battery box example. 2021-05-21 14:00:57 +02:00
David Lechner 73cc441edb github: add release action
This publishes the Python package to PyPI when a release is created on
GitHub.
2021-05-17 16:42:16 -05:00
David Lechner 7770a88aa0 github: fix build action name
It does more than just build the Python package.
2021-05-17 16:38:58 -05:00
David Lechner f06caa32bc 3.0.0-rc.1 2021-05-17 16:35:37 -05:00
thesynman fb8198fe8f pybricks/robotics.pyi: improve type hint (#60)
* Allow the wheel diameter and axle track of a DriveBase to be an int or a float
2021-05-10 13:08:25 -05:00
David Lechner 3dad15ac11 examples: fix use of OSError
We generally shouldn't be raising OSError from user code since it
represents an error the bubbles up from the OS. Also, when handling
an OSError, we almost always want to check for a specific error code.
2021-04-29 09:38:16 -05:00
Laurens Valk 790fcfa66a examples/pup/iodevices: Add PUPDevice example. 2021-04-29 13:03:34 +02:00
David Lechner d108d7c163 doc/common/conf: use xcode syntax highlighting
This matches the style used in Pybricks Code.
2021-04-28 15:54:11 -05:00
Martyn Boogaarts 7ce3721b48 examples/pup/hub_shared: Update light animation examples.
See https://github.com/pybricks/support/issues/253

* Update light_animate.py

corrected syntax

* Update light_animate.py

corrected syntax

* Update light_animate.py

corrected syntax

* Update light_animate.py

corrected syntax
2021-04-24 21:36:10 +02:00
David Lechner d0bfbcb4d1 js: only apply target="_blank" to IDE build
On the web, we want to be able to navigate between the various Pybricks
subdomains without opening new tabs. But Pybricks Code is treated as an
"app", we don't want links to open in Pybricks Code.
2021-04-20 12:38:33 -05:00
David Lechner 2aadc75f2c poetry: bump version to match current firmware 2021-04-20 12:07:36 -05:00
David Lechner 8bf42c7d2d poetry: Bump RTD and theme versions.
This is mainly to pull in the requirement of docutils < 0.17 from
sphinx-rtd-theme. Just bumping to latest sphinx doc while we are at it.

Issue: https://github.com/pybricks/pybricks-api/issues/55
2021-04-12 11:12:23 +02:00
Laurens Valk de13c01673 api/nxtdevices: Update color method.
This shares the implementation with the PUP color sensors, so update accordingly.
2021-04-10 15:31:29 +02:00
Laurens Valk ca96ee2fce examples: Update detectable colors API. 2021-04-10 15:31:28 +02:00
Laurens Valk 68f626f1ef doc/pupdevices: Update usage of color. 2021-04-10 15:31:28 +02:00
Laurens Valk 570fac30c5 api/parameters/Color: Fix color definitions.
Match the implementation.
2021-04-10 15:31:28 +02:00
Laurens Valk 1f0be98649 api/parameters/Color: Add missing color typing. 2021-04-10 15:31:27 +02:00
Laurens Valk e91590feec examples/pup/sensor: Fix use of lights.on.
The documentation says to use a list or tuple of brightness values.

https://github.com/pybricks/support/issues/273

Implementation fixed via https://github.com/pybricks/pybricks-micropython/commit/28b5413c2b41283a5c1ea3e8cccf4a2900dd7fc3
2021-04-09 15:44:08 +02:00
Laurens Valk 597b6d682f @pybricks/ide-docs v1.2.0 2021-04-09 12:31:37 +02:00
Laurens Valk 9c8d41efb8 doc/index: Update install note in IDE docs. 2021-04-09 12:21:47 +02:00
Laurens Valk a06e01c6de doc/start_pup/ev3: Drop installation guide.
These are now at https://pybricks.com/install/
2021-04-07 19:56:56 +02:00
David Lechner 186c46f52c api/pybricks/messaging: fix BluetoothMailboxServer close
As per standard Python socketserver, there is `server_close()` rather than `close()`.

Fixes #51
2021-04-07 19:42:33 +02:00
Laurens Valk 7679b8b47d examples/hubs/MoveHub: imu examples 2021-02-17 23:31:19 +01:00
Laurens Valk c14f1cf473 api/hubs/MoveHub: add basic imu
This is similar to the other hubs, but with reduced functionality.
2021-02-17 23:23:40 +01:00
Jerry Nicholls 6ce8336c26 doc/common/Motor: fix docstring for run_target
Changed "does" to "doesn't" for the target angle. The sign of the speed is irrelevant.
2021-02-15 19:12:41 +01:00
Laurens Valk c46b249c8c @pybricks/ide-docs v1.1.1 2021-02-14 19:32:52 +01:00
Laurens Valk 67008b67d8 doc/ide: include installation guide 2021-02-14 19:26:10 +01:00
Laurens Valk 9c1beef6b6 doc/parameters/Port: move doc to rst 2021-02-14 19:00:52 +01:00
Laurens Valk 5eb7a143fa doc/parameters/Stop: move doc to rst 2021-02-14 19:00:52 +01:00
Laurens Valk fc04059d86 doc/parameters/Button: move doc to rst 2021-02-14 19:00:45 +01:00
Laurens Valk 0082f0502a doc/parameters/Direction: move doc to rst 2021-02-14 18:44:25 +01:00
Laurens Valk e7dc4bb609 doc/parameters/Side: move doc to rst 2021-02-14 18:41:17 +01:00
Laurens Valk fb86e4bcef doc/parameters/Stop: fix typo 2021-02-14 16:21:37 +01:00
Laurens Valk 632908f59a doc/parameters: split out page per class 2021-02-14 16:06:23 +01:00
Laurens Valk 4a7fa12eaa config: add classlink directive
We have index pages for most modules now, which link to individual classes. It is helpful if these empty class headers are hyperlinks. This commit does just that.

For most sensors/devices so far this is not really necessary as the images are already hyperlinks. But this will become more useful as we start adding index pages like these for classes without images, such as parameters.
2021-02-14 15:39:39 +01:00
Jorge Pereira 109fcf19c1 examples/pup/motor: update motor_action_basic
Demo of run_angle had a typo
2021-02-14 13:54:58 +01:00
Laurens Valk 3229da030b doc/start_pup: update getting started instructions 2021-02-14 12:41:05 +01:00
Laurens Valk 4b052fa66d doc/pupdevices/motor: drop image alignment
Fixes https://github.com/pybricks/pybricks-api/issues/40
2021-02-12 11:10:51 +01:00
Laurens Valk 3c6ebd09bd doc/parameters/Color: add examples 2021-02-12 10:53:40 +01:00
Laurens Valk af1b84afe2 api/parameters/Color: drop name attribute 2021-02-12 10:16:43 +01:00
Laurens Valk 45dbd7db5a config: display border around white div
Makes it easier to see white box on white background.
2021-02-12 10:15:58 +01:00
Laurens Valk a7699d6546 api/common/Control: add load method 2021-02-10 18:49:51 +01:00
Laurens Valk 55c83cb026 api/common: add torque limit setter
Also document units of torque
2021-02-10 15:48:56 +01:00
David Lechner deb211bdb7 @pybricks/ide-docs v1.1.0 2021-01-28 12:31:19 -06:00
David Lechner 8a5e5c3fb4 doc/ide: styling to match Pybricks Code
We were injecting this from Pybricks code, but it caused the scroll bars
to flash when loading a page.
2021-01-28 12:31:19 -06:00
ZPhilo 2a1640f7dc examples/pup/hubs/hub_primehub: fix button
Corrected Bluetooth button name (from BT to BLUETOOTH)
2021-01-28 09:31:41 +01:00
Laurens Valk 535aac8144 config: fix missing automembers in sphinx upgrade
This setting was renamed and should now be a dictionary.

Fixes https://github.com/pybricks/pybricks-api/issues/45
2021-01-28 09:30:23 +01:00
David Lechner 00cc5ee44e poetry: move dev dependencies to dev section
Users who install this package from PyPi don't need all of the dev dependencies.
2021-01-26 11:46:32 -06:00
Laurens Valk f0b882b576 config: update to Sphinx 3.4 2021-01-26 09:18:13 +01:00
Laurens Valk 8ed45aecfb doc/nxtdevices: drop method link
For some reason, these are not working after upgrading to Sphinx 3.X, even though the same reference to conversion works just fine elsewhere.
2021-01-26 09:07:19 +01:00
David Lechner 77605e8701 github: add workflow for publishing ide-docs package 2021-01-26 08:30:48 +01:00
David Lechner b4c8242133 doc/ide: add node package
This will be used to publish the docs in a way that is easy for
pybricks-code to use.
2021-01-26 08:30:48 +01:00
David Lechner 06e01e5ac8 doc/ide: use sphinx.ext.imgmath
MathJax uses a CDN to to distribute the package. So in order to use the
docs offline, we would have to include our own copy. But it is a bit
large (50-ish MB), so it is easier to use sphinx.ext.imgmath instead
to generate svg images.

The situation might be different with MathJax v3, but that requires
Sphinx v4.
2021-01-26 08:30:48 +01:00
David Lechner ff22c32c24 doc/api/signaltypes: use ^{\circ} instead of ° in :math:
This works for both sphinx.ext.mathjax and sphinx.ext.imgmath.
2021-01-26 08:30:48 +01:00
David Lechner 95eb999493 doc/api/signaltypes: fix degree symbol overlapping
The degree symbol was a bit too close to the letters.
2021-01-26 08:30:48 +01:00
David Lechner 7d729a8e9e doc/ide: hide the "view source" link
Since these are meant to be offline docs and use a smaller screen area
we can omit this to keep things cleaner.
2021-01-26 08:30:48 +01:00
David Lechner c750a3cd88 doc/ide: hide prev/next buttons
In the IDE this is more of a reference and less of a book so going to
the next page doesn't make as much sense.
2021-01-26 08:30:48 +01:00
David Lechner adf6e03bc9 doc: open external links in a new window
This adds a hack to open external links in a new window. Requires Sphinx v1.8.
2021-01-26 08:30:48 +01:00
David Lechner 0466ce947f doc: override external link style on figure target
This works around https://github.com/readthedocs/sphinx_rtd_theme/pull/494#issuecomment-354063112
2021-01-26 08:30:48 +01:00
David Lechner 7abb670f66 doc/ide: hide footers
This information is duplicated in the IDE about dialog so we don't need
it in the docs.
2021-01-26 08:30:48 +01:00
Laurens Valk 55d7a8a254 examples/pup: acceleration and angular velocity 2021-01-20 16:02:36 +01:00
Laurens Valk e051455e23 examples/pup: add imu tilt examples 2021-01-20 14:55:27 +01:00
Laurens Valk 4b5b97bbb2 examples/pup: add imu up() example 2021-01-20 11:13:24 +01:00
Laurens Valk 1573508f75 examples/pup/primehub: auto rotate display 2021-01-20 11:05:09 +01:00
Laurens Valk 018b0d8b9d examples: simplify hub script generator
Instead of saying that some lines should be skipped, just say for which hubs the entire script will work.
2021-01-20 10:56:21 +01:00
Laurens Valk 47d7fa46d8 examples: drop common inventorhub scripts
The doc page has been merged into one page, with all examples using the PrimeHub class.
2021-01-20 10:40:26 +01:00
Laurens Valk 21e5400ff3 api/common/IMU: publish draft API 2021-01-19 15:09:06 +01:00
Laurens Valk bb77e0f413 doc/hubs: link inventorhub to primehub 2021-01-19 11:45:14 +01:00
Laurens Valk c5851a3569 doc/ide: add landing page images 2021-01-19 11:42:21 +01:00
Laurens Valk 93f27f61e7 doc/hubs: make naming consistent 2021-01-19 11:19:39 +01:00
Laurens Valk 7d40e07dfb doc/hubs: InventorHub and PrimeHub on same page
Make it a bit more explicit that they are the same.
2021-01-19 11:18:21 +01:00
Laurens Valk 5ab71de988 doc/ide: improve landing page
Add visuals to quickly get to hubs or pupdevices. These still need to be made into smaller more generic images, but these will do for now.
2021-01-18 16:34:10 +01:00
Laurens Valk d7254472f0 doc/ide: simplify landing page and menu
The embedded docs will only have the module documentation. Remove everything else.
2021-01-18 16:33:14 +01:00
Laurens Valk 245542ce4d doc/iodevices/PUPDevice: move compatibility note 2021-01-18 16:33:14 +01:00
Laurens Valk 31891d0970 doc/ide: Drop EV3 pages 2021-01-18 16:33:14 +01:00
Laurens Valk 3cc9ec157e doc/api: avoid more ev3 references 2021-01-18 16:33:05 +01:00
Laurens Valk 9aa00fac15 doc/parameters: generalize Direction info
Avoid links to EV3-specifics, because they may not be present in some builds.
2021-01-18 15:36:07 +01:00
Laurens Valk 2a2ba8c6aa config: build both targets on CI 2021-01-18 14:36:13 +01:00
Laurens Valk db4cbe66c1 all: update copyright year 2021-01-18 14:34:28 +01:00
Laurens Valk 087dab5ed1 doc/ide: add build target for Pybricks Code
poetry run make -C doc SOURCEDIR=ide html

This adds a build target for docs to integrate in Pybricks Code. This commit makes the build target produce an identical copy, by making each page reference its original rst file.

Now we can easily exclude certain components (such as EV3) as needed for Pybricks Code, and also change the main index / welcome page.
2021-01-18 12:50:27 +01:00
Laurens Valk 69c32e5c0d doc: fix image paths
Use full path just like all other images in the api docs
2021-01-18 12:42:15 +01:00
Laurens Valk 14ad697565 doc/start_ev3: use rst files instead of inc
Use standard sphinx conventions as much as possible.
2021-01-18 12:00:38 +01:00
Laurens Valk d2a6b07e0c doc/start_ev3: move download link 2021-01-18 11:52:49 +01:00
Laurens Valk 853b141153 doc/start_ev3: group as folder 2021-01-18 11:52:24 +01:00
Laurens Valk 12a6b49f97 doc/frames: drop unused file 2021-01-18 11:13:51 +01:00
Laurens Valk 06c1d00f22 config: drop contentui plugin
We are no longer using this
2021-01-13 16:54:18 +01:00
Laurens Valk 8c0d7a3904 doc/parameters: drop content tabs for sides 2021-01-13 16:54:18 +01:00
Laurens Valk 9b5590047d doc/parameters: drop content tabs for ports 2021-01-13 16:54:28 +01:00
Laurens Valk 46d9e3c119 doc/iodevices: refactor
Split all classes to their own file. This keeps things organized, and allows per-class comments about compatibility. Also flatten toggled examples.
2021-01-13 16:54:18 +01:00
Laurens Valk bb7c9adbb8 doc/start_pup: drop toggles 2021-01-13 15:55:08 +01:00
Laurens Valk 5f4ef05c6e doc/tools: move data logging to separate page
Expand the EV3 examples without toggles, and without making the tools page too long.
2021-01-13 15:44:39 +01:00
Laurens Valk 5bbbff2550 doc/messaging: expand examples
Drop use of toggle via plugin.
2021-01-13 15:13:51 +01:00
Laurens Valk 8f637c52cd doc/media: drop toggle ui 2021-01-13 14:25:08 +01:00
Laurens Valk f826e7641c doc/media: footnote instead of toggle for language
This is a way to make the language list non-distracting without the contentui plugin
2021-01-12 16:50:43 +01:00
Laurens Valk 400067c364 doc/hubs/ev3brick: use footnote instead of toggle
This is a way to make the language list non-distracting without the contentui plugin
2021-01-12 16:50:18 +01:00
Laurens Valk 92311b65fb examples/pup/hub_primehub: no need to call off()
The animation is now cleared automatically when invoking the pixel method, so there's no need to call this manually anymore.

See https://github.com/pybricks/support/issues/195
2021-01-12 16:32:20 +01:00
Laurens Valk 05ecf8bcb6 doc/hubs: show IMU on Prime and Technic Hub 2021-01-05 16:31:35 +01:00
Laurens Valk 1f991302e5 doc/common: fix unit of acceleration 2021-01-05 16:31:35 +01:00
Laurens Valk f3f0532f74 doc/hubs: move note about identical classes
Otherwise, it was shown after the newly added __init__ docstring, which was confusing.
2021-01-05 16:31:35 +01:00
Laurens Valk 3a9e5728c6 api/hubs: add axis initializers for IMU 2021-01-05 16:31:35 +01:00
Laurens Valk 2a97b62603 doc/hubs: add note about hub instance attributes 2021-01-05 16:31:35 +01:00
Laurens Valk 64146f5afa doc/geometry: axis and orientation conventions 2021-01-05 16:31:21 +01:00
Laurens Valk e52130b627 api/hubs/inventorhub: enable IMU
The minimal change to start reviewing and improving IMU api and docs.
2021-01-04 17:25:16 +01:00
Laurens Valk a2583944d9 api/geometry: move Axis from parameters
This location makes more sense. Also drop Axis.ANY = None, which is more confusing than helpful. Instead, use relevant docstring to explain what None will do.
2021-01-04 17:25:15 +01:00
Laurens Valk 4c6c149d4a doc/start_pup: update link to CI builds 2021-01-04 15:28:03 +01:00
Laurens Valk 9835ee9dbe doc/hubs/primehub: update button graphic
The graphic showed Button.BT but it is now Button.BLUETOOTH
2020-12-30 12:42:47 +01:00
Laurens Valk 755d0520a6 api/parameters/Button: pass buttons on init
This matches the implementation.
2020-12-30 12:39:06 +01:00
Laurens Valk 08c55218fa api/parameters/Button: add bluetooth button 2020-12-30 12:36:37 +01:00
Laurens Valk 352bff564c api/parameters/Button: add remote buttons
Also clean up how it is displayed by reading the attributes from the API instead of copying them.
2020-12-30 12:27:12 +01:00
Laurens Valk 313a51219a api/pupdevices/Remote: add address
After connecting (automatically), this address can be printed so next time you can connect directly without scanning.

This is useful if you have more than one remote.
2020-12-29 20:16:34 +01:00
Laurens Valk c2d2884794 api/pupdevices/Remote: publish draft api 2020-12-29 19:51:48 +01:00
Laurens Valk 32a47bcee0 doc/nxtdevices: do not collapse example
In the long run, this page needs to be split up just like pupdevices. At this time, the nxtdevices page has only one example, so we simply remove the toggle header.
2020-12-29 14:53:13 +01:00
Laurens Valk b5890437de doc/pupdevices/PFMotor: split examples
Now that each device is on its own page, we no longer need to collapse snippets to reduce page size. Now they can just all be at the bottom of the page. This also gives each a dedicated link which is easier when giving support.
2020-12-29 14:48:09 +01:00
Laurens Valk b0af924cfc doc/pupdevices/UltrasonicSensor: split examples
Now that each device is on its own page, we no longer need to collapse snippets to reduce page size. Now they can just all be at the bottom of the page. This also gives each a dedicated link which is easier when giving support.
2020-12-29 14:47:06 +01:00
Laurens Valk 915d445561 doc/pupdevices/TiltSensor: split examples
Now that each device is on its own page, we no longer need to collapse snippets to reduce page size. Now they can just all be at the bottom of the page. This also gives each a dedicated link which is easier when giving support.
2020-12-29 14:44:50 +01:00
Laurens Valk 070264647f doc/pupdevices/Light: split examples
Now that each device is on its own page, we no longer need to collapse snippets to reduce page size. Now they can just all be at the bottom of the page. This also gives each a dedicated link which is easier when giving support.
2020-12-29 14:43:08 +01:00
Laurens Valk ab1f58c2cc doc/pupdevices/InfraredSensor: split examples
Now that each device is on its own page, we no longer need to collapse snippets to reduce page size. Now they can just all be at the bottom of the page. This also gives each a dedicated link which is easier when giving support.
2020-12-29 14:42:11 +01:00
Laurens Valk d6bc72c3c1 doc/pupdevices/ForceSensor: split examples
Now that each device is on its own page, we no longer need to collapse snippets to reduce page size. Now they can just all be at the bottom of the page. This also gives each a dedicated link which is easier when giving support.
2020-12-29 14:41:06 +01:00
Laurens Valk 4e2aec6c35 doc/pupdevices/motor: split examples
Now that each device is on its own page, we no longer need to collapse snippets to reduce page size. Now they can just all be at the bottom of the page. This also gives each a dedicated link which is easier when giving support.
2020-12-29 14:35:07 +01:00
Laurens Valk 2375a1abcb doc/pupdevices/colorsensor: split examples
Now that each sensor is on its own page, we no longer need to collapse snippets to reduce page size. Now they can just all be at the bottom of the page. This also gives each a dedicated link which is easier when giving support.
2020-12-29 14:10:41 +01:00
Laurens Valk ab4da63029 doc/hubs: move examples to dedicated sections
Now that each hub is on its own page, we no longer need to collapse snippets to reduce page size. Now they can just all be at the bottom of the page. This also gives each a dedicated link which is easier when giving support.
2020-12-29 13:58:17 +01:00
Laurens Valk ab384b464b doc/pupdevices/colordistancesensor: split examples
Now that each sensor is on its own page, we no longer need to collapse snippets to reduce page size. Now they can just all be at the bottom of the page. This also gives each a dedicated link which is easier when giving support.
2020-12-29 12:08:29 +01:00
Laurens Valk d2de1089d6 doc/hubs/index: clean up thumbnail page 2020-12-29 11:50:55 +01:00
Laurens Valk b76b6cf835 doc/pupdevices: one page per sensor
This page was getting very long, so split it up for easier navigation (#33).
2020-12-29 11:47:27 +01:00
Laurens Valk a92eae867b typing/pupdevices: remove stray docstring 2020-12-29 09:32:11 +01:00
Laurens Valk 0a86e0a719 typing/common: fix Keypad return type
Follows 8a1716d5e2
2020-12-29 09:31:00 +01:00
Laurens Valk 7800ab05b2 typing/common: fix nonexistent scalar type 2020-12-29 09:29:47 +01:00
David Lechner 032d3786bf github: update target python versions 2020-12-28 18:47:11 -06:00
David Lechner db65f8d646 api: add type hints for v3
This updates the type hints for the current v3 API.
2020-12-28 18:47:11 -06:00
David Lechner 3a66b8e053 api: add type hints for v2
This adds PEP 561 style type hints for Pybricks v2 (just EV3).
2020-12-28 18:47:04 -06:00
Laurens Valk 8a1716d5e2 api/common/Keypad: change return type to tuple
This follows an implementation change that was made for performance reasons (https://github.com/pybricks/pybricks-micropython/commit/95741ac2f8f118396a517a38f4d0f7fb92136f82).
2020-12-23 11:45:37 +01:00
Laurens Valk abe4c1bc9a doc/common/Keypad: fix name
Keypad is one word, so the class is not spelled KeyPad.
2020-12-23 11:43:48 +01:00
Laurens Valk 84b882f8b8 api/hubs/InventorHub: add speaker instance 2020-12-18 13:35:19 +01:00
Laurens Valk c3fc818037 doc/common/Speaker: move note information back
We were hiding this under a toggle menu to reduce the page size of the hubs module. Now that each hub is on its own page, this is no longer necessary.

In turn, this makes it easier to document the same method for other hubs.
2020-12-18 13:32:18 +01:00
Laurens Valk 57ff8312f3 api/iodevices/PUPDevice: add info() method 2020-12-18 13:20:17 +01:00
Laurens Valk 68511bd3eb doc/iodevices: note on I2C/UART on Powered Up 2020-12-14 10:34:41 +01:00
Laurens Valk ba4fe80b50 doc/iodevices: add PUPDevice class 2020-12-14 10:27:23 +01:00
Laurens Valk b7d728a86e doc/iodevices: move LUMPDevice to EV3 only section
Also update graphic used for this device class.
2020-12-14 10:16:02 +01:00
Laurens Valk 1e751d6afc api/iodevices/LUMPDevice: drop write method
EV3 UART devices do not support writing.
2020-12-14 10:08:09 +01:00
Laurens Valk aaf98308f7 api/iodevices/PUPDevice: copy from LUMPDevice
Powered Up devices have many differences compared to EV3 UART devices, so it is better to split them to dedicated classes.

The biggest difference is that PUPDevice class will allow writing to sensors and toggling battery power to the device.
2020-12-14 10:07:13 +01:00
Laurens Valk 3e322165f5 doc/hubs: include light matrix display examples 2020-11-11 18:57:04 +01:00
Laurens Valk 1c201b5f8c examples/pup: generate light matrix examples 2020-11-11 18:56:38 +01:00
Laurens Valk abe1be18b2 examples/pup: add common light matrix display 2020-11-11 17:09:44 +01:00
Laurens Valk 983562f7b8 doc/hubs/inventorhub: document light, display, buttons 2020-11-06 15:59:02 +01:00
Laurens Valk 1c9d0dd86f api/hubs/PrimeHub: enable buttons 2020-11-06 15:55:48 +01:00
Laurens Valk 22a057d6e3 doc/common/LightGrid: existing pixels do not re-orient
This is currently a limitation of the implementation, and may be changed later on.
2020-11-06 15:22:00 +01:00
Laurens Valk e92fd1f05b doc/hubs/primehub: align button and display 2020-11-06 12:45:49 +01:00
Laurens Valk 9a45c6582c doc/hubs/PrimeHub: add labeled diagrams 2020-11-06 12:38:03 +01:00
Laurens Valk 3e3af62713 doc/start_ev3: drop absolute path reference 2020-11-06 12:33:21 +01:00
Laurens Valk c93875729a doc/hubs/PrimeHub: add hub diagrams
document lights, row/col index, buttons
2020-11-06 12:32:45 +01:00
Laurens Valk 3288591cc3 doc/parameters: Add ports E, F 2020-11-06 12:31:42 +01:00
Laurens Valk 8f21cea345 api/common: clean up Light Matrix
This renames the generic class from LightGrid to LightMatrix. The instance object is simply called display.

This makes user scripts easier to type and read.

This also cleans up most of the draft docstrings for this class and fixes a few argument typos.
2020-11-06 12:31:42 +01:00
Laurens Valk 4e9886dba8 api/geometry: add new module
This module will contain mathematical tools to deal with geometry and motion of robots. This includes a Matrix type for common matrix operations.
2020-11-06 12:31:42 +01:00
Laurens Valk cb91368b32 api/common/LightGrid: add orientation setter 2020-11-06 12:31:42 +01:00
Laurens Valk 17b1151490 doc/parameters/Side: clarify sides for screens 2020-11-06 12:31:42 +01:00
Laurens Valk 6083992914 doc/parameters: add diagrams to designate sides
This adds labeled images for each hub/sensor for which the side is relevant, so that there can be no confusion over which is the left/right, top/bottom, or front/back side.
2020-11-06 12:31:38 +01:00
Laurens Valk 70ed79076d api/parameters: add Side enum
This will be used to designate orientations of hubs/sensors/screens.
2020-11-04 10:19:35 +01:00
Laurens Valk 31f2e9b071 examples: update paths in docs 2020-11-04 10:17:33 +01:00
Laurens Valk b0ffb24a2e examples: import snippets from pybricks-projects
These code samples are rendered in the docs, so we include them here.

For the git history of these snippets, see:
https://github.com/pybricks/pybricks-projects/commits/f4914069aaacfd9ab1e0dd6f05524f62cfc56b29/snippets
2020-11-04 10:17:33 +01:00
Laurens Valk 30e87695ea pybricks-projects: remove submodule
This dependency was causing extra maintenance, which we can avoid by bringing the snippets into this repository.
2020-11-04 10:17:33 +01:00
Laurens Valk 429d5d4d0d doc/pupdevices: add gray large angular motor 2020-10-26 10:17:32 +01:00
Laurens Valk 7b23db5abd doc/start_pup: update outdated notes
The stable version of Google Chrome has the required BLE support, so we can remove the steps about the beta version.

Also update the note on Boost beta and light status.
2020-10-25 21:49:26 +01:00
Laurens Valk 5c8809f542 doc/start_pup: add powered up hubs image
Make it easier to see which hubs we support.
2020-10-25 21:42:13 +01:00
Laurens Valk 9bcbfd2512 doc/primehub: note to clarify classes are the same 2020-10-25 21:34:05 +01:00
Laurens Valk 1e7991f68d doc/inventorhub: expose hub in the docs 2020-10-25 21:31:05 +01:00
Laurens Valk b29dab4d6b doc/start_ev3: add link to stable 2.0 docs 2020-10-25 21:00:54 +01:00
Laurens Valk d2a5cb2d60 doc/hubs: make visual table of contents 2020-10-25 20:51:56 +01:00
Laurens Valk 7b090d56d8 doc/hubs: move hubs to dedicated pages
The hubs module page was getting too long, leading to much scrolling.
2020-10-25 20:37:51 +01:00
Laurens Valk bcf610a29e doc/index: regroup hubs by platform
Make it easier to pick the right installation guide.
2020-10-25 19:51:40 +01:00
Laurens Valk 55001644d2 doc/start_inventor: add placeholder quick start
This adds an empty page so we can link to it from the main page.
2020-10-25 19:49:18 +01:00
Laurens Valk eef4e9f672 api/hubs: add InventorHub
This is just the SPIKE Prime Hub with a different name and color.
2020-10-25 10:25:16 +01:00
Laurens Valk 3de7f92e8a pybricks-projects: update set examples 2020-10-23 19:32:32 +02:00
Laurens Valk d4c44a292c api: add PrimeHub 2020-10-09 22:50:49 +02:00
Laurens Valk 90bea73c11 doc/hubs: Add light examples 2020-10-09 22:46:35 +02:00
Laurens Valk a603c19d0e doc/hubs: expose color light functionality
This enables the blink and animate methods.

The examples are not yet included.
2020-10-09 19:58:35 +02:00
Laurens Valk c3eb31d348 doc/common: fix cross references 2020-10-09 19:58:35 +02:00
Laurens Valk 1b730836e4 api/pupdevices/Light: drop blink, animate
External single-color lights won't have this for now.
2020-10-09 19:58:35 +02:00
Laurens Valk 4c65e994a3 config: create funding file 2020-10-09 19:58:23 +02:00
Laurens Valk ede503f6fe config: rename CPlusHub to TechnicHub
This replaces the name in internal files.
2020-10-09 19:16:33 +02:00
Laurens Valk 24d35993e9 api: rename CPlusHub to TechnicHub
This reflects the newly adopted naming convention.

See https://github.com/pybricks/support/issues/119
2020-10-09 19:16:33 +02:00
Laurens Valk d6651fc3c5 api/pupdevices: replace color_map
This reclects the implementation update that changes how
color sensing is performed and interfaced with by the user.
2020-10-08 20:19:33 +02:00
Laurens Valk 6671e3def0 pybricks-projects: update color sensing examples 2020-10-08 19:25:04 +02:00
Laurens Valk 6662862b43 api/parameters: Color divide value
This is the inverse of scaling by a constant through multiplication.
2020-10-07 09:17:02 +02:00
Laurens Valk 500bac9929 api/parameters/Color: allow scaling to alter hue
This makes it easy for users to vary brightness of the default colors without having to create a whole new object.
2020-08-26 21:12:48 +02:00
Laurens Valk 5e6a8c8334 api/parameters/Color: name is None by default
This is more consistent with the rest of our API.
2020-08-26 21:12:38 +02:00
Laurens Valk 4f27a465c4 api/common/LightGrid: drop on() method
This method is inconsistent with the on methods for other light related classes so it is better to delete it.
2020-08-25 16:27:19 +02:00
Laurens Valk f490a3b2c2 api/common/LightArray: add blink and animate 2020-08-25 16:27:19 +02:00
Laurens Valk 9ae4955344 api/parameters/Color: no name by default
When no name is given, the color remains untitled
2020-08-25 16:27:19 +02:00
Laurens Valk b89da4b061 api/common/ColorLight: add blink and animate
These are the generalizations of the corresponding methods for single color lights.
2020-08-25 13:38:09 +02:00
Laurens Valk b974ead0dc api/common/ColorLight: drop hsv function
The on() method takes a color type, which is an HSV color, so a separate hsv method is not needed.

hub.light.on(Color.GREEN)
hub.light.on(Color(120))
hub.light.on(Color(h=120, s=100, 50))
2020-08-25 13:38:09 +02:00
Laurens Valk 0427436df6 doc/common/LightGrid: clarify how blink and pattern relate
blink is just a simpler animation
2020-08-25 13:38:09 +02:00
Laurens Valk 4319b2fad8 api/common/Light: add blink and animate 2020-08-25 13:38:09 +02:00
Laurens Valk 0fb150be19 api/common/LightGrid: add animate method 2020-08-25 13:37:54 +02:00
Laurens Valk 6d0984f5fc api/common/LightGrid: simplify image method
Now it just displays a Matrix/2D list. We can omit manipulations like clear=False. Composing can be done by simply adding two matrices instead.

We also drop the compressed format. Instead we could have a helper function that gives you a
matrix based on a list of integers in the now-deleted format.
2020-08-25 12:42:14 +02:00
Laurens Valk b708fe283c api/common/LightGrid: rename char argument
This follows a change in the unreleased implementation.
2020-08-25 12:42:14 +02:00
Laurens Valk 74d59b43ac api/common/LightGrid: revise text method
Specify on and off time for consistency with future blink method.

Adding some off time helps reading text with subsequent charachters that are the same. For example, now "Hello" reads H e l l o instead of Helo.

Also drop wait argument for now because it is not currently implemented and may never be.
2020-08-25 12:42:10 +02:00
Laurens Valk c6c14afca2 doc/parameters/Color: add colors to each class atribute
This makes it much easier to pick the right color.
2020-08-12 12:22:14 +02:00
Laurens Valk 282e34b9e0 config: add pybricks-color directive
This directive produces a small box with the color from the Pybricks API:

.. pybricks-color:: CYAN
2020-08-12 12:19:49 +02:00
Laurens Valk 1eb75e24e7 api/parameters/Color: generalize color type
First step towards making a color type with HSV representation.

Colors such as Color.RED or Color.BLUE continue to exist, but now you
can also define your own colors:

DARK_RED = Color(h=0, s=100, v=50)
2020-08-12 12:18:24 +02:00
Laurens Valk be8592f096 doc/pupdevices/PFMotor: Documentation and examples 2020-08-11 12:13:06 +02:00
Laurens Valk 4d88fbbbd2 api/pupdevices/PFMotor: DCMotor functionality
This replaces the on-off method in ColorDistanceSensor.remote()
with a PFMotor class that works just like the DCMotor class. This
provides much more functionality without having to invent a new API.
2020-08-11 12:05:53 +02:00
Laurens Valk 70ffbfa4f3 doc/parameters/Color: sort colors by hue/value 2020-08-10 11:39:56 +02:00
Laurens Valk c987bc2f80 api/parameters/Color: add CYAN, MAGENTA, GRAY 2020-08-10 11:34:58 +02:00
Laurens Valk 7b8a848c61 api/parameters/Color: remove BROWN
Brown has the same hue as orange, just with a lower value and/or
saturation,  so it does not need to have a separate Color instance.
It is also not supported by the color_map methods.

It was originally included in this list because the EV3 Color Sensor
can technically detect it. This is not reliable, however, as it is
also reports this value for orange objects at a slightly larger
distance. The implementation may be updated to return orange
in both cases. If the original values are required, the LUMPDevice
may be used to get the original color index.
2020-08-10 11:29:48 +02:00
Laurens Valk 0c5457a5f2 api/parameters/Color: rename PURPLE to VIOLET
The correct term for hue = 270 is violet.
Purple is just magenta with a lower brightness value.
2020-08-10 11:29:32 +02:00
Laurens Valk 6aa6059974 doc/pupdevices: add Motor action examples 2020-07-21 16:14:35 +02:00
Laurens Valk 98f247688e doc/pupdevices: add Motor measuring examples 2020-07-21 14:50:26 +02:00
Laurens Valk 51f9d916e0 doc/pupdevices: add Motor init examples 2020-07-21 14:50:26 +02:00
Laurens Valk 8a9386ffc5 doc/pupdevices: add DCMotor examples 2020-07-21 14:50:26 +02:00
Bert bcd44dad84 doc/start_pup: fix mixed http and https contents
Fixes #106.
2020-07-19 21:47:11 +02:00
Laurens Valk ac96985c71 doc/pupdevices/ForceSensor: add examples 2020-07-13 15:40:59 +02:00
Laurens Valk b98f487f3c doc/pupdevices/ColorSensor: add examples 2020-07-13 14:24:57 +02:00
Laurens Valk 42917f14ef doc/parameters: fix link to move hub
This is no longer a generic hub reference
2020-07-12 13:17:45 +02:00
Laurens Valk 938c62430f doc/hubs: remove content tabs
This caused links not to work to anything other than the default tab.
2020-07-12 13:11:38 +02:00
Laurens Valk 6132ae66da doc/pupdevices/ColorDistanceSensor: add examples 2020-07-11 19:40:00 +02:00
Laurens Valk a02c7023e5 doc/pupdevices/ColorDistanceSensor: group methods
We are already using a rubric for the lights, so add two more to better
group the many methods of this sensor.
2020-07-11 17:09:49 +02:00
Laurens Valk d15aa22131 doc/pupdevices/Light: and blink and fade examples 2020-07-11 13:00:28 +02:00
Laurens Valk 19009d1637 doc/pupdevices: InfraredSensor, TiltSensor example 2020-07-11 12:46:30 +02:00
Laurens Valk 4dbaf5f68e doc/pupdevices/UltrasonicSensor: math example 2020-07-10 13:06:22 +02:00
Laurens Valk af2b1c66c9 doc/pupdevices/UltrasonicSensor: add example 2020-07-10 12:42:20 +02:00
Laurens Valk 3488e1fb83 doc/pupdevices/UltrasonicSensor: document invalid
Document how invalid values are reported.
2020-07-10 12:32:52 +02:00
Laurens Valk f26d750fbf doc/ev3devices/InfraredSensor: document mode delay 2020-07-10 11:46:04 +02:00
Laurens Valk 6e6c8956b9 doc/start_pup: clean up custom firmware steps 2020-07-10 11:35:39 +02:00
Laurens Valk 80a426bc4f doc/start_pup: update instructions
- We no longer require a password
- We support more hubs
- Mention known key issues
- Simplify Chrome 85 discussion
- Add instructions to unplug cables prior to update
2020-07-10 11:21:12 +02:00
Laurens Valk 93da01c7ce api/pupdevices/ColorDistanceSensor: add hsv
The hsv and color_map methods are the same as for the SPIKE ColorSensor class, except for the surface kwarg.
2020-07-07 14:07:35 +02:00
Laurens Valk 55c4c86c23 api/_common: fix speaker file kwarg
In the implementation, the kwarg is called "file". Instead of fixing the implementation which is already released, we fix the docs.
2020-07-07 09:50:36 +02:00
Laurens Valk 82b16dc8de api/_common: fix DriveBase speed kwarg
In the implementation, the kwarg is called "speed". Instead of fixing the implementation which is already released, we fix the docs.
2020-07-07 09:50:30 +02:00
Laurens Valk 8078b6febb doc/_common/ColorLight: docstring clean up
This adds a (commented out) preview of the methods to the city hub light
2020-07-07 09:44:16 +02:00
Laurens Valk 8a43dc936a doc/signaltypes: add hue placeholder
We will have to add a helpful diagram, but having the placeholder allows us to link to it already.
2020-07-07 09:44:16 +02:00
Laurens Valk 7d1fbe9ce9 api/_common/Light: add reset to system behavior
This makes lights behave as they would if the user script did not use them at all.
2020-07-07 09:44:16 +02:00
Laurens Valk 38a1cf9712 api/_common/Light: drop repeat kwarg
The pattern will always repeat, for simplicity.
2020-07-07 09:44:16 +02:00
Laurens Valk 102039385a api/_common/ColorLight: add pattern
This adds the method equivalent to the recent addition of a single
color light. The only difference is that now a color is returned instead
of a single brightness. The provided color or HSV tuple will be stored
as RGB samples internally, as is already done for pbio light patterns.

In the simplest blinking form this could be:

hub.light.pattern(lambda t: Color.RED if t >= 1000 else None, 2000)

Or a fading, one-color sine:

def fade(time):
    v = sin(time/2000/pi)*50+50
    h = 360
    s = 100
    return (h, s, v)

hub.light.pattern(fade, 1000)
2020-07-07 09:44:16 +02:00
Laurens Valk e780a65007 api/_common/ColorLight: change rgb to hsv
This makes it much easier to have fine grained control
over colors and cycle through them easily (0--360).

This also makes it consistent with sensor APIs. Now you
can measure the color and plug it into this method.

We can make this change because none of
the implementations use this yet.

If we feel we miss out by dropping the RGB, it would be more fitting
to instead expose R, G, and B attributes which point to instances of
the Light class. However, this is using more memory for something that
isn't very useful.

We could also just provide generic color converters between rgb, hsv,
and perhaps hex html color strings, not tied to any particular light or
sensor.
2020-07-07 09:44:16 +02:00
Laurens Valk b8505ff218 api/_common/Light: introduce pattern
Currently, Pybricks has system patterns for builtin lights.
This adds a user method to set such a pattern.

For example, an indefinite sine pattern could be specified by

def fade(time):
    return sin(time/2000/pi)*50+50

hub.light.pattern(fade, 1000)

or a blinking pattern using

def blink(time):
    if time >= 1000:
        return 100
    else:
        return 0

hub.light.pattern(blink, 2000)

or briefly:

hub.light.pattern(lambda t: 100 if t >= 1000 else 0, 2000)

This combines the best of simplicity and efficiency: The user doesn't
have to calculate and provide an expensive list of floating points, but
provide a clean and adaptable method instead.
By sampling, we maintain a fixed length pattern which we can preallocate
for the hub lights, and the samples are calculated only once and the
callable may be garbage collected if given as lambda. Also, any
exceptions will be caught immediately during the one-off evaluation.
2020-07-07 09:44:16 +02:00
Laurens Valk 20fec6461a api/_common/LightGrid: make image more efficient
Usually, images are static, so they can be computed in advance instead of during runtime. This makes scripts smaller and much more memory efficient.

For example, now you can say:

HOUSE = 4685823

hub.grid.image(HOUSE)

since 4685823 =
```
0 0 1 0 0
0 1 1 1 0
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
```

We could also choose the binary format to allow for more generic screen sizes. If we allow a bit more space (2 words instead of 1), we could do 1 byte per row to allow screens up to 8x8. Right now, though, we choose 1 word < 31 bits which is a bit more efficient in MicroPython.

We can easily list numerous example in the docs or provide a simple visual calculator.

There is still a matrix method that takes a 2D matrix of intensities for full control during runtime, which is what the image() method was doing initially. This commit renames the old draft to matrix().
2020-07-07 09:44:16 +02:00
Laurens Valk d66e18b113 api/pupdevices: add TiltSensor
This class and its methods are subject to change when the complete
API for IMUs is introduced.
2020-07-01 13:33:36 +02:00
Laurens Valk 55fe666dac api/pupdevices: add InfraredSensor 2020-07-01 12:02:13 +02:00
David Lechner 3554814c86 config: add Pybricks favicon 2020-06-17 13:38:22 -05:00
David Lechner fd75e94824 config: drop python 3.5 in CI build
python 3.6 is required for certain features we are using.
2020-06-17 13:13:14 -05:00
David Lechner 70cc605b56 config: update version to 3.0
We are working on the v3.0 release now.
2020-06-17 13:04:06 -05:00
Laurens Valk 0779b8df16 doc/pupdevices: workaround to show class attribute
We are using an older version of Sphinx which does not support
autodoc of inherited class attributes yet. This works
around it by just referencing the EV3 attribute, which does work.
2020-06-14 15:39:04 +02:00
Laurens Valk ecc30c2d92 doc/start_pup: add imports to example
This reflects a firmware update that makes it more consistent with
pybricks-micropython for EV3. Making imports explicit is also more
Pythonic. This will make it clearer when some classes are not available
on some hubs.
2020-06-09 14:28:32 +02:00
Laurens Valk 80840396aa api/pupdevices: add Powered Up Light 2020-06-08 15:26:19 +02:00
David Lechner c536081dea doc/start_pup: fix line too long lint error 2020-06-06 13:47:28 -05:00
David Lechner 87a488e790 doc/start_pup: update chrome download link
A new dev build was released for all platforms yesterday with the required patches.
2020-06-06 11:15:41 -05:00
Laurens Valk 90647e25dd doc/start_pup: update chrome release schedule 2020-06-05 16:17:23 +02:00
Laurens Valk 01c6e29dd5 doc/start_pup: add note about password 2020-06-05 15:56:04 +02:00
Laurens Valk 1eac0972ac api/hubs: add CPlusHub 2020-06-05 15:56:04 +02:00
Laurens Valk ce087f5330 doc/index: fix pup link 2020-06-05 15:56:04 +02:00
Laurens Valk 9e06245860 doc/pup_start: basic run instructions 2020-06-05 15:56:04 +02:00
Laurens Valk 4b9cedb444 doc/start_pup: add install instructions 2020-06-05 15:56:04 +02:00
Laurens Valk a99c4328fc doc/start_pup: explain firmware restore 2020-06-05 15:56:04 +02:00
Laurens Valk 07b4b5b783 doc/start_pup: instructions for permanent program 2020-06-05 15:56:04 +02:00
Laurens Valk 13be26443b doc/start_pup: add firmware install video 2020-06-05 15:56:04 +02:00
Laurens Valk ce993900d1 api/pupdevices: update illuminate argument
match the implementation and simplify description
2020-05-27 13:58:30 +02:00
Laurens Valk f604dd321e api/pupdevices/UltrasonicSensor: drop silent
Like its EV3 counterpart, this does not work reliably enough, so remove.
2020-05-27 13:58:30 +02:00
Laurens Valk e0ac54ec0a api/pupdevices/ForceSensor: add methods 2020-05-27 13:58:30 +02:00
Laurens Valk 8273c00881 api/pupdevices/UltrasonicSensor: add methods
This is identical to the EV3 Ultrasonic Sensor methods.
2020-05-27 13:58:30 +02:00
Laurens Valk 4da7b456bb api/pupdevices: initial color sensor hsv api
Provide a simple yet powerful way to calibrate the color() method.
2020-05-27 13:58:30 +02:00
Laurens Valk 7498751ee3 doc/pupdevices: add diagrams with light indices
Make this clear once and for all.
This order comes from the sensor itself.
2020-05-27 13:58:30 +02:00
Laurens Valk a8b0306afe doc/pupdevices: flip ultrasonic sensor diagram 2020-05-27 13:58:30 +02:00
Laurens Valk 2dd133d5e5 api/pupdevices: add ForceSensor
Initial class without any methods for the SPIKE Force Sensor
2020-05-27 13:58:30 +02:00
Laurens Valk e67c048b18 api/pupdevices: add UltrasonicSensor
Initial class without any methods for the SPIKE Ultrasonic Sensor
2020-05-27 13:58:30 +02:00
Laurens Valk 10b6808037 api/pupdevices: add ColorSensor
Initial class without any methods for the SPIKE Color Sensor
2020-05-27 13:58:30 +02:00
Laurens Valk 2d3e85f531 api/_common.LightArray: merge on and array method
Make it simpler with only one method to turn the lights on.
2020-05-27 13:58:30 +02:00
593 changed files with 21270 additions and 6201 deletions
+2
View File
@@ -0,0 +1,2 @@
github: [pybricks]
@@ -1,17 +1,17 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
name: Build Python package and docs
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]
python-version: [3.8, 3.9]
steps:
- uses: actions/checkout@v2
@@ -32,6 +32,12 @@ jobs:
- name: Build package
run: poetry build
- name: Lint docs
run: poetry run doc8 --extension .inc
- name: Build html docs
run: poetry run doc8
- name: Build html docs for Read the Docs
run: poetry run make -C doc html
- name: Install IDE docs dependencies
run: |
sudo apt-get update
sudo apt-get install dvisvgm preview-latex-style texlive texlive-fonts-extra texlive-latex-extra
- name: Build html docs for Pybricks Code IDE
run: poetry run make -C doc html TAG=ide
+38
View File
@@ -0,0 +1,38 @@
name: Release @pybricks/ide-docs
on:
push:
tags:
- '@pybricks/ide-docs/**'
jobs:
publish_ide_docs:
runs-on: ubuntu-20.04
steps:
- name: Ubuntu packages
run: |
sudo apt-get update
sudo apt-get install -y dvisvgm preview-latex-style texlive texlive-fonts-extra texlive-latex-extra
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install poetry
poetry run python -m pip install --upgrade pip
poetry run python -m pip install --upgrade setuptools
poetry install
- uses: actions/setup-node@v1
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- run: yarn build
working-directory: npm/ide-docs
- run: yarn publish
working-directory: npm/ide-docs
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
+22
View File
@@ -0,0 +1,22 @@
name: Release to PyPI
on:
release:
types: [published]
jobs:
build_and_publish:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: 1.1.6
- run: poetry install
- run: poetry build
- run: poetry publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
-3
View File
@@ -1,6 +1,3 @@
[submodule "pybricks-projects"]
path = pybricks-projects
url = https://github.com/pybricks/pybricks-projects
[submodule "media/ev3dev-media"]
path = media/ev3dev-media
url = https://github.com/ev3dev/ev3dev-media.git
+22
View File
@@ -0,0 +1,22 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
#
# Settings in the readthedocs online dashboard will be ignored.
# Required
version: 2
# Build documentation in the doc/main directory with Sphinx
sphinx:
configuration: doc/main/conf.py
# Build your docs in additional formats such as PDF
formats:
- pdf
# Set the version of Python and requirements required to build the docs
python:
version: 3.8
install:
- requirements: rtd-requirements.txt
+11 -3
View File
@@ -1,10 +1,17 @@
{
"python.pythonPath": "${workspaceFolder}/.venv",
"python.linting.pycodestyleEnabled": false,
"python.formatting.provider": "black",
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.pycodestyleEnabled": false,
"python.linting.enabled": true,
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-python.python"
},
"python.languageServer": "Pylance",
"files.associations": {"*.inc": "restructuredtext"},
"restructuredtext.confPath": "${workspaceFolder}/doc/api",
"restructuredtext.confPath": "${workspaceFolder}/doc/main",
"spellright.language": [
"en_US"
],
@@ -32,5 +39,6 @@
"plaintext",
"python",
"restructuredtext",
]
],
"rewrap.wrappingColumn": 78,
}
+2 -1
View File
@@ -15,7 +15,7 @@ builtins
cdot
Celcius
cityhub
cplushub
technichub
de
dev
en
@@ -78,3 +78,4 @@ thermistor
toctree
TODO
UART
utf-8
+108
View File
@@ -0,0 +1,108 @@
# Changelog
<!-- refer to https://keepachangelog.com/en/1.0.0/ for guidance -->
## 3.2.0b1 - 2022-06-02
### Added
- Code auto-completion for `hub.charger`, `hub.imu` and `hub.system`.
- Moved typing from several `.pyi` files to the actual python modules.
### Fixed
- Fixed code completion for `DCMotor` and `Motor` classes in MS Python VS Code extension.
- Fixed missing `DCMotor` type in `ev3devices`.
- Fixed type hint for `Motor.reset_angle()` in `pupdevices`.
### Changed
- Setter for acceleration can now also be used to set acceleration and
deceleration to different values, using a two-valued tuple.
## 3.1.0 - 2021-12-16
### Added
- Added maximum voltage setter for `DCMotor` and `Motor`.
- Documented `DriveBase.curve()` method.
### Changed
- Removed `duty` setting from `Control.limits` method.
- Removed `integral_range` setting from `Control.pid` method.
### Fixed
- Fixed link to Color Light Matrix page.
- Fixed link to Inventor Hub page.
## 3.1.0rc1 - 2021-11-19
### Added
- Added `ColorLightMatrix` class.
- Added `LWP3Device` class.
**NOTE: version number after this point were from JavaScript package and do
not correspond to Pybricks firmware version numbers.**
## 1.6.0 - 2021-08-30
### Added
- MicroPython module documentation.
- Examples for hub system functions including stop button and shutdown.
### Changed
- Build IDE docs as main docs with minor changes, instead of a completely
separate build.
- Moved motor control documentation to the motor page.
## 1.5.0 - 2021-07-01
### Added
- Documentation for Powered Up Remote Control.
## 1.4.0 - 2021-06-23
### Added
- Enabled beta content that was hidden for the 3.0 release.
- Added notice about using the latest beta version.
## 1.3.3 - 2021-05-21
### Changed
- Match example snippet styling to IDE.
- Add more examples.
## 1.3.2 - 2021-04-26
## Changed
- Theme style fixes.
- Example code fixes
- Match doc version to firmware version.
## 1.3.1 - 2021-04-12
### Changed
- Upgrade sphinx and rtd-theme to fix style issues.
## 1.3.0 - 2021-04-12
### Removed
- Removed features which not be in the official 3.0 release. These features
are still in beta. They'll come back in future releases once tested.
## 1.2.0 - 2021-04-09
### Changed
- Moved installation guide to external site.
## 1.1.1 - 2021-02-14
### Added
- Added installation guide.
- Various documentation fixes.
## 1.1.0 - 2021-01-28
### Added
- Scrollbar styling.
## 1.0.0 - 2021-01-25
### Added
- Sphinx build output.
+104 -15
View File
@@ -20,23 +20,103 @@ will actually be implemented.
- Commit messages have a one-line subject, a blank line and a multiline body:
prefix: subject
prefix: Subject of the change.
body...
- Use a prefix to categorize the change. Usually this is the path the the file
being changed.
- If it is a documentation change, it can be shortened to `doc/<file>` (omit
`api` from the path).
- If it is an API change (in the `pybricks` folder), write `api/<file>`
instead of `pybricks/<file>`.
- The subject briefly describes _what_ was changed, e.g. `fix typo`.
- Use a prefix to categorize the change:
- Use the import path as the prefix whenever possible. Examples:
- pybricks.tools: Add StopWatch class.
- pybricks.tools: Reorganize RST files.
- pybricks.tools.StopWatch: Fix return type.
- pybricks.tools.wait: Add example of waiting.
- pybricks.pupdevices: Fix all sensor class ports.
- umath.sin: Fix spelling of Hypotenuse.
- If an import path makes no sense, just use the file path without
extensions:
- .vscode/settings: Fix file associations.
- The subject briefly describes _what_ was changed. Use a short full sentence
as in the examples above.
- The body describes _why_ the change was made, e.g. `The word "sensor" was
spelled incorrectly`.
- See the [commit history][commits] for more examples.
[commits]: https://github.com/pybricks/pybricks-api/commits/master
**General docstring principles:**
The stubs libraries in this repository have two different purposes:
1. Auto-generating documentation with Sphinx. For this purpose, the
documentation should be concise and clear.
2. Provide autocomplete and intellisense in code editors. For this purpose,
the code needs to be 100% correct. This way, computers can parse your code
correctly and tell you when something is wrong.
Since these objectives don't always align, we address these separately in the
stubs library:
1. The first line(s) of the docstring contain the function or method signature
as it should be displayed in the human-readable documentation.
2. The real function signature can be as complex as it needs to be to make it
correct for intellisense. Overloads can be uses if needed.
In the rare case where the docstring signature is the same as the typed
version, we'll still include it for consistency.
**Docstring details:**
Make sure to look at existing function signatures and docstrings for
inspiration when documenting new functionality. As an example, consider:
```python
def run_until_stalled(
self,
speed: Number,
then: Stop = Stop.COAST,
duty_limit: Optional[Number] = None,
) -> int:
"""
run_until_stalled(speed, then=Stop.COAST, duty_limit=None) -> int: deg
Runs the motor at a constant speed until it stalls.
Arguments:
speed (Number, deg/s): Speed of the motor.
then (Stop): What to do after coming to a standstill.
duty_limit (Number, %): Duty cycle limit during this
command. This is useful to avoid applying the full motor
torque to a geared or lever mechanism. If it is ``None``, the
duty limit won't be changed during this command.
Returns:
Angle at which the motor becomes stalled.
"""
```
The real method signature at the top contains the full detail, including the
type of each argument and return value.
The docstring starts with the signature. Use more than one signature if needed
to represent overloaded methods. The signatures are written in the way they
should be displayed in the docs:
- Argument types are omitted because they are also shown with the argument
description below.
- Default values should be given (``then=Stop.COAST``).
- The return type should be given (``-> int``). When applicable, include
the unit of the return value, so it becomes ``-> int: deg``
Then follows a concise description of what this method, function, or class
does.
Then follows a list of arguments:
- For each argument, include the expected type and unit if applicable, e.g.
``(int)`` or ``(Number, deg/s)``.
- Use ``Number`` when ``int`` and ``float`` are both allowed.
- If the description is long, use the indentation shown above.
- Make it readable. Instead
of ``Union[float, SupportsFloat, complex, SupportsComplex]``,
just say _float or complex_.
Then follows a description of the return value. The type is omitted here since
it is already include in the docstring signature.
**Development environment:**
@@ -46,8 +126,8 @@ Prerequisites:
- [Python 3][python]
- [Poetry][poetry]
Information on installing prerequisites can be found on the [pybricks-micropython
wiki][wiki].
Information on installing prerequisites can be found on the
[pybricks-micropython contributor's guide][contributing].
Initial setup:
@@ -59,15 +139,24 @@ Build docs:
# Linux
poetry run make -C doc html
xdg-open doc/api/build/html/index.html
xdg-open doc/main/build/html/index.html
# macOS
poetry run make -C doc html
open doc/api/build/html/index.html
open doc/main/build/html/index.html
# Windows (PowerShell)
poetry run doc\make.bat html
Invoke-Item doc\api\build\html\index.html
Invoke-Item doc\main\build\html\index.html
Building IDE docs variant:
# Linux/macOS
poetry run make -C doc html TAG=ide
# Windows (PowerShell)
$env:TAG="ide"
poetry run doc\make.bat html
Linting:
@@ -78,4 +167,4 @@ Linting:
[git]: https://git-scm.com/
[python]: https://www.python.org/
[poetry]: https://python-poetry.org/
[wiki]: https://github.com/pybricks-micropython/wiki
[contributing]: https://github.com/pybricks/pybricks-micropython/blob/master/CONTRIBUTING.md
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2018-2020 The Pybricks Authors
Copyright (c) 2018-2021 The Pybricks Authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+7 -3
View File
@@ -5,12 +5,16 @@
SPHINXOPTS = -W
SPHINXBUILD = sphinx-build
SPHINXPROJ = Pybricks
SOURCEDIR = api
SOURCEDIR = main
BUILDDIR = "$(SOURCEDIR)"/build
TAG = main
ifeq ($(BETA),1)
BETATAG = "-tbeta"
endif
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(TAG) $(BETATAG) $(O)
.PHONY: help Makefile
@@ -21,4 +25,4 @@ diagrams:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) -t $(TAG) $(BETATAG) $(O)
-21
View File
@@ -1,21 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Pybricks documentation build configuration file
#
import os
# General information about the project.
project = 'pybricks-micropython'
copyright = '2018-2020 The Pybricks Authors'
author = ''
_TITLE = 'Pybricks Modules and Examples'
_DISCLAIMER = 'LEGO, the LEGO logo, MINDSTORMS and the MINDSTORMS EV3 logo are\
trademarks and/or copyrights of the LEGO Group of companies \
which does not sponsor, authorize or endorse this site.'
html_logo = '../common/images/pybricks-logo-rtd.png'
latex_logo = '../common/images/pybricks-logo-large.png'
exec(open(os.path.abspath("../common/conf.py")).read())
-11
View File
@@ -1,11 +0,0 @@
0 Name: pupmotors
0 Author: Pybricks {laurens@pybricks.com}
0 !LICENSE MIT
1 15 -420 -56 -250 1 0 0 0 1 0 0 0 1 26910.dat
1 15 10 -80 140 1 0 0 0 1 0 0 0 1 28738.dat
1 71 -270 -40 630 1 0 0 0 1 0 0 0 1 22127.dat
1 15 200 -96 600 -1 0 0 0 1 0 0 0 -1 28739.dat
1 15 470 -16 -90 1 0 0 0 1 0 0 0 1 45601p02.dat
1 15 -800 -40 360 1 0 0 0 1 0 0 0 1 95646c01.dat
1 15 -1160 32 -310 1 0 0 0 1 0 0 0 1 53788c01.dat
1 71 -1340 -40 430 1 0 0 0 1 0 0 0 1 87576c01.dat
-8
View File
@@ -1,8 +0,0 @@
0 Name: pupmotors
0 Author: Pybricks {laurens@pybricks.com}
0 !LICENSE MIT
1 15 430 -96 190 0 0 1 1 0 0 0 1 0 54675c01.dat
1 15 410 -72 30 0 0 1 1 0 0 0 1 0 54696c01.dat
1 71 230 -144 0 1 0 0 0 1 0 0 0 1 22169c01.dat
1 71 40 -216 0 1 0 0 0 1 0 0 0 1 22172c01.dat
1 15 -140 -320 80 1 0 0 0 1 0 0 0 1 26913c01.dat
Binary file not shown.

Before

Width:  |  Height:  |  Size: 576 KiB

-12
View File
@@ -1,12 +0,0 @@
0 Name: pupmotors
0 Author: Pybricks {laurens@pybricks.com}
0 !LICENSE MIT
1 15 600 -280 240 -1 0 0 0 -1 0 0 0 1 37316c01.dat
1 15 60 -272 160 -1 0 0 0 -1 0 0 0 1 37312c01.dat
1 15 -400 -280 240 -1 0 0 0 -1 0 0 0 1 37308c01.dat
1 0 -400 -310 -374 -1 0 0 0 -1 0 0 0 1 u9218c01.dat
1 15 -400 -320 -410 0 0 1 0 1 0 -1 0 0 20841.dat
1 15 630 -320 -420 1 0 0 0 1 0 0 0 1 26912.dat
1 0 630 -310 -384 -1 0 0 0 -1 0 0 0 1 u9218c01.dat
1 15 60 -320 -430 0 0 1 0 1 0 -1 0 0 20844.dat
1 0 60 -310 -394 -1 0 0 0 -1 0 0 0 1 u9218c01.dat
-32
View File
@@ -1,32 +0,0 @@
Working with vectors
====================
Scalars and Vectors
~~~~~~~~~~~~~~~~~~~~~~~
.. _scalar:
scalar
--------------
TODO
.. _vector:
vector
--------------
TODO
Robot reference frame
~~~~~~~~~~~~~~~~~~~~~~~
.. _robotframe:
Robot reference frame
----------------------
TODO (explanation, diagram, etc)::
* X: To the right
* Y: forward
* Z: upward
-40
View File
@@ -1,40 +0,0 @@
:mod:`hubs <pybricks.hubs>` -- Programmable Hubs
================================================
.. module:: pybricks.hubs
.. _fig_hubs:
Select your programmable hub using the buttons below.
.. content-tabs::
.. tab-container:: ev3brick
:title: EV3 Brick
.. figure:: ../api/images/ev3brick.png
:height: 15 em
.. include:: hubs_ev3brick.inc
.. tab-container:: movehub
:title: Move Hub
.. figure:: ../api/images/movehub_label.png
:height: 15 em
.. include:: hubs_movehub.inc
.. tab-container:: cityhub
:title: City Hub
.. figure:: ../api/images/cityhub.png
:height: 15 em
.. include:: hubs_cityhub.inc
.. tab-container:: cplushub
:title: Control+ Hub
.. figure:: ../api/images/cplushub.png
:height: 15 em
-15
View File
@@ -1,15 +0,0 @@
.. autoclass:: pybricks.hubs.CityHub
:no-members:
.. rubric:: Using the hub status light
.. automethod:: pybricks.hubs::CityHub.light.on
.. automethod:: pybricks.hubs::CityHub.light.off
.. rubric:: Using the battery
.. automethod:: pybricks.hubs::CityHub.battery.voltage
.. automethod:: pybricks.hubs::CityHub.battery.current
-230
View File
@@ -1,230 +0,0 @@
.. autoclass:: pybricks.hubs.EV3Brick
:no-members:
.. rubric:: Using the buttons
.. automethod:: pybricks.hubs::EV3Brick.buttons.pressed
.. rubric:: Using the brick status light
.. automethod:: pybricks.hubs::EV3Brick.light.on
.. toggle-header::
:header: **Show/hide example**
**Example: Turn the light on and change the color.**
.. literalinclude::
../../pybricks-projects/snippets/ev3/light_color/main.py
.. automethod:: pybricks.hubs::EV3Brick.light.off
.. rubric:: Using the speaker
.. automethod:: pybricks.hubs::EV3Brick.speaker.beep
.. automethod:: pybricks.hubs::EV3Brick.speaker.play_notes
.. toggle-header::
:header: **Show/hide musical note format**
Each note is a string with the following format:
- The first character is the name of the note, ``A`` to ``G``
or ``R`` for a rest.
- Note names can also include an accidental ``#`` (sharp) or
``b`` (flat). ``B#``/``Cb`` and ``E#``/``Fb`` are not
allowed.
- The note name is followed by the octave number ``2``
to ``8``. For example ``C4`` is middle C. The octave changes
to the next number at the note C, for example, ``B3`` is the
note below middle C (``C4``).
- The octave is followed by ``/`` and a number that indicates
the size of the note. For example ``/4`` is a quarter note,
``/8`` is an eighth note and so on.
- This can optionally followed by a ``.`` to make a dotted
note. Dotted notes are 1-1/2 times as long as notes without a
dot.
- The note can optionally end with a ``_`` which is a tie or a
slur. This causes there to be no pause between this note and
the next note.
.. automethod:: pybricks.hubs::EV3Brick.speaker.play_file
.. automethod:: pybricks.hubs::EV3Brick.speaker.say
.. automethod:: pybricks.hubs::EV3Brick.speaker.set_speech_options
.. toggle-header::
:header: **Show/hide available languages and voices**
You can choose the following languages:
- ``'af'``: Afrikaans
- ``'an'``: Aragonese
- ``'bg'``: Bulgarian
- ``'bs'``: Bosnian
- ``'ca'``: Catalan
- ``'cs'``: Czech
- ``'cy'``: Welsh
- ``'da'``: Danish
- ``'de'``: German
- ``'el'``: Greek
- ``'en'``: English (default)
- ``'en-gb'``: English (United Kingdom)
- ``'en-sc'``: English (Scotland)
- ``'en-uk-north'``: English (United Kingdom, Northern)
- ``'en-uk-rp'``:
English (United Kingdom, Received Pronunciation)
- ``'en-uk-wmids'``: English (United Kingdom, West Midlands)
- ``'en-us'``: English (United States)
- ``'en-wi'``: English (West Indies)
- ``'eo'``: Esperanto
- ``'es'``: Spanish
- ``'es-la'``: Spanish (Latin America)
- ``'et'``: Estonian
- ``'fa'``: Persian
- ``'fa-pin'``: Persian
- ``'fi'``: Finnish
- ``'fr-be'``: French (Belgium)
- ``'fr-fr'``: French (France)
- ``'ga'``: Irish
- ``'grc'``: Greek
- ``'hi'``: Hindi
- ``'hr'``: Croatian
- ``'hu'``: Hungarian
- ``'hy'``: Armenian
- ``'hy-west'``: Armenian (Western)
- ``'id'``: Indonesian
- ``'is'``: Icelandic
- ``'it'``: Italian
- ``'jbo'``: Lojban
- ``'ka'``: Georgian
- ``'kn'``: Kannada
- ``'ku'``: Kurdish
- ``'la'``: Latin
- ``'lfn'``: Lingua Franca Nova
- ``'lt'``: Lithuanian
- ``'lv'``: Latvian
- ``'mk'``: Macedonian
- ``'ml'``: Malayalam
- ``'ms'``: Malay
- ``'ne'``: Nepali
- ``'nl'``: Dutch
- ``'no'``: Norwegian
- ``'pa'``: Punjabi
- ``'pl'``: Polish
- ``'pt-br'``: Portuguese (Brazil)
- ``'pt-pt'``: Portuguese (Portugal)
- ``'ro'``: Romanian
- ``'ru'``: Russian
- ``'sk'``: Slovak
- ``'sq'``: Albanian
- ``'sr'``: Serbian
- ``'sv'``: Swedish
- ``'sw'``: Swahili
- ``'ta'``: Tamil
- ``'tr'``: Turkish
- ``'vi'``: Vietnamese
- ``'vi-hue'``: Vietnamese (Hue)
- ``'vi-sgn'``: Vietnamese (Saigon)
- ``'zh'``: Mandarin Chinese
- ``'zh-yue'``: Cantonese Chinese
You can choose the following voices:
- ``'f1'``: female variant 1
- ``'f2'``: female variant 2
- ``'f3'``: female variant 3
- ``'f4'``: female variant 4
- ``'f5'``: female variant 5
- ``'m1'``: male variant 1
- ``'m2'``: male variant 2
- ``'m3'``: male variant 3
- ``'m4'``: male variant 4
- ``'m5'``: male variant 5
- ``'m6'``: male variant 6
- ``'m7'``: male variant 7
- ``'croak'``: croak
- ``'whisper'``: whisper
- ``'whisperf'``: female whisper
.. automethod:: pybricks.hubs::EV3Brick.speaker.set_volume
.. rubric:: Using the screen
.. |this image| replace:: the screen
.. automethod:: pybricks.hubs::EV3Brick.screen.clear
.. automethod:: pybricks.hubs::EV3Brick.screen.draw_text
.. automethod:: pybricks.hubs::EV3Brick.screen.print
.. toggle-header::
:header: **Show/hide example**
**Example: Say hello... in several ways.**
.. raw:: latex
\begin{CJK}{UTF8}{gbsn}
.. literalinclude::
../../pybricks-projects/snippets/ev3/screen_print/main.py
.. raw:: latex
\end{CJK}
.. automethod:: pybricks.hubs::EV3Brick.screen.set_font
**Example:** See example in :meth:`print`.
.. automethod:: pybricks.hubs::EV3Brick.screen.load_image
.. toggle-header::
:header: **Show/hide example**
**Example: Show an image on the screen.**
.. literalinclude::
../../pybricks-projects/snippets/ev3/screen_image/main.py
.. automethod:: pybricks.hubs::EV3Brick.screen.draw_image
.. automethod:: pybricks.hubs::EV3Brick.screen.draw_pixel
.. automethod:: pybricks.hubs::EV3Brick.screen.draw_line
.. toggle-header::
:header: **Show/hide example**
**Example: Draw some shapes on the screen.**
.. literalinclude::
../../pybricks-projects/snippets/ev3/screen_draw/main.py
.. automethod:: pybricks.hubs::EV3Brick.screen.draw_box
**Example:** See example in :meth:`draw_line`.
.. automethod:: pybricks.hubs::EV3Brick.screen.draw_circle
**Example:** See example in :meth:`draw_line`.
.. autoattribute:: pybricks.hubs::EV3Brick.screen.width
.. autoattribute:: pybricks.hubs::EV3Brick.screen.height
.. automethod:: pybricks.hubs::EV3Brick.screen.save
.. rubric:: Using the battery
.. automethod:: pybricks.hubs::EV3Brick.battery.voltage
.. automethod:: pybricks.hubs::EV3Brick.battery.current
-14
View File
@@ -1,14 +0,0 @@
.. autoclass:: pybricks.hubs.MoveHub
:no-members:
.. rubric:: Using the hub status light
.. automethod:: pybricks.hubs::MoveHub.light.on
.. automethod:: pybricks.hubs::MoveHub.light.off
.. rubric:: Using the battery
.. automethod:: pybricks.hubs::MoveHub.battery.voltage
.. automethod:: pybricks.hubs::MoveHub.battery.current
Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 669 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

-96
View File
@@ -1,96 +0,0 @@
Welcome to Pybricks!
==================================================================
This documentation has everything you need to install Pybricks and
run your first scripts.
**Step 1: Install Pybricks**
To get started, go to the :doc:`EV3 Quick Start <start_ev3>`
or the :doc:`Powered Up Quick Start <start_ev3>` or pick your hub
below.
.. list-table::
* - **EV3 Brick**
- **Move Hub**
- **City Hub**
- **Control+ Hub**
* - .. image:: images/ev3brick.png
:target: start_ev3.html
- .. figure:: images/movehub.png
:target: start_pup.html
- .. figure:: images/cityhub.png
:target: start_pup.html
- .. figure:: images/cplushub.png
:target: start_pup.html
**Step 2: Start coding!**
After you've followed the installation steps for your hub,
check out the Pybricks modules in the left hand menu to see what
you can do.
**Step 3: Share what you made (or ask for help!)**
Got questions or issues? Please share your
findings on our `support page`_ so we can make Pybricks even better.
*Thank you!*
.. _support page: https://github.com/pybricks/support/issues/
.. toctree::
:maxdepth: 1
:caption: Table of Contents
:hidden:
.. toctree::
:maxdepth: 1
:caption: Pybricks
:hidden:
Home Page <https://pybricks.com>
Downloads <https://pybricks.com/downloads/>
Example Projects <https://github.com/pybricks/pybricks-projects>
Support <https://github.com/pybricks/support/issues/>
About Pybricks <https://pybricks.com/about/>
.. toctree::
:maxdepth: 1
:caption: Getting started
:hidden:
start_ev3
start_pup
.. toctree::
:maxdepth: 1
:caption: Pybricks Modules
:hidden:
hubs
pupdevices
ev3devices
nxtdevices
iodevices
parameters
tools
robotics
media
messaging
.. toctree::
:maxdepth: 1
:caption: Engineering Extras
:hidden:
signaltypes
motors
.. frames
-27
View File
@@ -1,27 +0,0 @@
:mod:`iodevices <pybricks.iodevices>` -- Generic I/O Devices
============================================================
.. automodule:: pybricks.iodevices
:no-members:
.. note::
This module provides classes to interact with unofficial motors, sensors,
and other custom electronics. You should only connect custom electronics
or unofficial devices if you know what you are doing. Proceed with caution.
LUMP Device
^^^^^^^^^^^^^
.. figure:: ../api/images/sensor_lump.png
:width: 80 %
.. autoclass:: pybricks.iodevices.LUMPDevice
.. raw:: html
<h1>EV3 Only</h1>
The classes listed below are **only available on the EV3**.
.. include:: iodevices_ev3.inc
-151
View File
@@ -1,151 +0,0 @@
Analog Sensor
^^^^^^^^^^^^^
.. figure:: ../api/images/sensor_rj12_brown.png
:width: 25 %
.. autoclass:: pybricks.iodevices.AnalogSensor
I2C Device
^^^^^^^^^^^^^
.. figure:: ../api/images/sensor_rj12_bluegreen.png
:width: 25 %
.. autoclass:: pybricks.iodevices.I2CDevice
.. toggle-header::
:header: **Show/hide example**
**Example: Read and write to an I2C device.**
.. literalinclude:: ../../pybricks-projects/snippets/ev3/i2c_basics/main.py
.. _i2caddress:
I2C Addresses
---------------
I2C addresses are 7-bit values. However, most vendors who make LEGO compatible
sensors provide an 8-bit address in their documentation.
To use those addresses, you must shift them by 1 bit.
For example, if the documented address is ``0xD2``, you can do
``address = 0xD2 >> 1``.
Advanced I2C Commands
---------------------
Some rudimentary I2C devices do not require a register argument or even any
data. You can achieve this behavior as shown in the examples below.
.. toggle-header::
:header: **Show/hide example**
**Example: Advanced I2C read and write techniques.**
.. literalinclude:: ../../pybricks-projects/snippets/ev3/i2c_extra/main.py
**Additional technical resources**
The ``I2CDevice`` class methods call functions from the Linux SMBus driver.
To find out which commands are called under the hood, check the
`Pybricks source code`_.
More details about using I2C without MicroPython can be found on
the `ev3dev I2C`_ page.
.. _ev3dev I2C: http://docs.ev3dev.org/projects/lego-linux-drivers/en/ev3dev-stretch/i2c.html
.. _Pybricks source code: https://github.com/pybricks/pybricks-micropython
UART Device
^^^^^^^^^^^^^
.. figure:: ../api/images/sensor_rj12_gray.png
:width: 25 %
.. autoclass:: pybricks.iodevices.UARTDevice
.. toggle-header::
:header: **Show/hide example**
**Example: Read and write to a UART device.**
.. literalinclude::
../../pybricks-projects/snippets/ev3/uart_basics/main.py
DC Motor
^^^^^^^^^^^^
.. figure:: ../api/images/rcxmotor.png
:width: 40 %
.. autoclass:: pybricks._common.DCMotor
:noindex:
:no-members:
.. automethod:: pybricks._common.DCMotor.dc
:noindex:
.. automethod:: pybricks._common.DCMotor.stop
:noindex:
Ev3dev sensors
^^^^^^^^^^^^^^^^^^^^^
.. figure:: ../api/images/sensor_ev3dev.png
:width: 70 %
EV3 MicroPython is built on top of ev3dev, which means that a sensor
may be supported even if it is not listed in this documentation. If so, you can
use it with the ``Ev3devSensor`` class. This is easier and faster than using
the custom device classes given above.
To check whether you can use the ``Ev3devSensor`` class:
* Plug the sensor into your EV3 Brick.
* Go to the main menu of the EV3 Brick.
* Select `Device Browser` and then `Sensors`.
* If your sensor shows up, you can use it.
Now select your sensor from the menu and choose `set mode`. This shows all
available modes for this sensor. You can use these mode names as the ``mode``
setting below.
To learn more about compatible devices and what each mode does,
visit the `ev3dev sensors`_ page.
.. autoclass:: pybricks.iodevices.Ev3devSensor
:no-members:
.. autoattribute:: pybricks.iodevices.Ev3devSensor.sensor_index
:annotation:
.. autoattribute:: pybricks.iodevices.Ev3devSensor.port_index
:annotation:
.. automethod:: pybricks.iodevices.Ev3devSensor.read
.. toggle-header::
:header: **Show/hide example: Reading values with the Ev3devSensor class**
**Example**
In this example we use the LEGO MINDSTORMS EV3 Color Sensor with the raw
RGB mode. This gives uncalibrated red, green, and blue reflection values.
.. literalinclude::
../../pybricks-projects/snippets/ev3/ev3devsensor/main.py
.. toggle-header::
:header: **Show/hide example: Extending the Ev3devSensor class**
**Example**
This example shows how to extend the ``Ev3devSensor`` class by accessing
additional features found in the Linux system folder for this device.
.. literalinclude::
../../pybricks-projects/snippets/ev3/ev3devsensor/class_example.py
.. _ev3dev sensors: http://docs.ev3dev.org/projects/lego-linux-drivers/en/ev3dev-stretch/sensors.html
.. _Mode name: http://docs.ev3dev.org/projects/lego-linux-drivers/en/ev3dev-stretch/sensor_data.html
.. _lego-sensor: http://docs.ev3dev.org/projects/lego-linux-drivers/en/ev3dev-stretch/sensors.html#the-lego-sensor-subsytem
.. _lego-port: http://docs.ev3dev.org/projects/lego-linux-drivers/en/ev3dev-stretch/ports.html#the-lego-port-subsystem
-1534
View File
File diff suppressed because it is too large Load Diff
-137
View File
@@ -1,137 +0,0 @@
More about Motors
===========================================
.. Motor Tips & Tricks
.. ^^^^^^^^^^^^^^^^^^^
.. The difference between ``run_angle`` and ``run_target``
.. -------------------------------------------------------
.. *TODO*
.. .. _absangles:
.. Absolute angles
.. ----------------------------
.. .. todo::
.. This section will be included in a future release.
.. .. _stalled:
.. Using stall detection
.. ---------------------
.. .. todo::
.. This section will be included in a future release.
.. When a motor cannot move any further despite using the maximally allowed
.. torque we say that the motor is stalled. Something could be blocking the
.. motor, or the load is just too heavy. For example, if you manually hold
.. the motor shaft still while the motor is busy executing a command, the
.. motor will stall.
.. What can I do with stall detection?
.. +++++++++++++++++++++++++++++++++++
.. Stall detection is useful to detect that a motor can't move any further.
.. This can be used to detect an endpoint of a mechanism. For example, you
.. can detect whether a robotic hand is fully closed, because the gripper
.. motor simply can't go further. This way, you don't need a touch or light
.. sensor to detect this.
.. *TODO: How, what, why. Explain run_until_stalled. Rack & pinion example.*
.. When is a motor stalled?
.. ++++++++++++++++++++++++
.. TODO
.. .. _gears:
.. Using gears
.. -----------------
.. .. todo::
.. This section will be included in a future release.
.. Many LEGO robots use mechanisms with gears to change the speed and torque
.. output of a motor. Let's consider the following dial mechanism.
.. *TODO: INSERT PICTURE OF MOTOR WITH 12z gear AND 36z gear.*
.. This gear train slows down the dial on the output axle by a factor of 3.
.. Therefore, if you want to rotate the dial by 90 degrees, the motor has to
.. rotate by 270 degrees. To turn at 200 degrees per second, the motor has to
.. turn at 600 degrees per second, and so on.
.. To avoid using this factor 3 everywhere in your program, you can use the
.. `gears` setting of the ``Motor`` object, as shown in this example::
.. # This example uses the EV3 brick, but the same
.. # technique applies to other programmable hubs.
.. ev3 = EV3Brick()
.. # Initialize the motor. See picture above.
.. dial = Motor(Port.C, Direction.COUNTERCLOCKWISE, gears=[12, 36])
.. # Turn the dial by 90-degrees
.. dial.run_angle(500, 90)
.. # Print the dial angle
.. print(dial.angle())
.. # Turn the dial back to the original position
.. dial.run_target(500, 0)
.. When you use any of the other methods, the same scaling is applied. For
.. example, you can print the angle of the dial as shown above. This will print
.. 90 (approximately), even though the motor has turned 270 degrees.
.. Notice that there is no magic going on. It is just a convenient scaling
.. function. This helps you organize your code. For example, if you change
.. your mechanism to use different gears, you only have to change the first
.. line of this example.
.. _control:
The Control Class
^^^^^^^^^^^^^^^^^
The ``Motor`` class uses PID control to accurately track your commanded target
angles. Similarly, the ``DriveBase`` class uses two of such controllers:
one to control the heading and one to control the traveled distance.
You can change the control settings through the following attributes, which are
instances of the ``Control`` class given below.:
- ``Motor.control``
- ``DriveBase.heading_control``
- ``DriveBase.distance_control``
You can only change the settings while the controller is stopped. For example,
you can set the settings at the beginning of your program. Alternatively, first
call ``stop()`` to make your ``Motor`` or ``DriveBase`` stop, and then change
the settings.
.. autoclass:: pybricks._common.Control
:no-members:
.. rubric:: Status
.. automethod:: pybricks._common.Control.done
.. automethod:: pybricks._common.Control.stalled
.. rubric:: Settings
.. automethod:: pybricks._common.Control.limits
.. automethod:: pybricks._common.Control.pid
.. automethod:: pybricks._common.Control.target_tolerances
.. automethod:: pybricks._common.Control.stall_tolerances
-144
View File
@@ -1,144 +0,0 @@
:mod:`pupdevices <pybricks.pupdevices>` -- Powered Up Devices
=============================================================
.. automodule:: pybricks.pupdevices
:no-members:
Motors without Rotation Sensors
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. _fig_pupdcmotors:
.. figure:: ../api/images/pupdcmotors_label.png
:width: 70 %
:alt: pupmotors
:align: center
Powered Up motors without rotation sensors. The arrows indicate the default
positive direction.
.. autoclass:: pybricks._common.DCMotor
:noindex:
:no-members:
.. automethod:: pybricks._common.DCMotor.dc
:noindex:
.. automethod:: pybricks._common.DCMotor.stop
:noindex:
.. automethod:: pybricks._common.DCMotor.brake
:noindex:
Motors with Rotation Sensors
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. _fig_pupmotors:
.. figure:: ../api/images/pupmotors_label.png
:width: 100 %
:alt: pupmotors
:align: left
Powered Up motors with rotation sensors. The arrows indicate the default
positive direction. See the :mod:`hubs <pybricks.hubs>` module for default
directions of built-in motors.
.. autoclass:: pybricks.pupdevices.Motor
:noindex:
:no-members:
.. rubric:: Measuring
.. automethod:: pybricks.pupdevices.Motor.speed
.. automethod:: pybricks.pupdevices.Motor.angle
.. automethod:: pybricks.pupdevices.Motor.reset_angle
.. rubric:: Stopping
.. automethod:: pybricks.pupdevices.Motor.stop
.. automethod:: pybricks.pupdevices.Motor.brake
.. automethod:: pybricks.pupdevices.Motor.hold
.. rubric:: Action
.. automethod:: pybricks.pupdevices.Motor.run
.. automethod:: pybricks.pupdevices.Motor.run_time
.. automethod:: pybricks.pupdevices.Motor.run_angle
.. automethod:: pybricks.pupdevices.Motor.run_target
.. automethod:: pybricks.pupdevices.Motor.run_until_stalled
.. automethod:: pybricks.pupdevices.Motor.dc
.. rubric:: Advanced motion control
.. automethod:: pybricks.pupdevices.Motor.track_target
.. autoattribute:: pybricks.pupdevices.Motor.control
:annotation:
Color and Distance Sensor
^^^^^^^^^^^^^^^^^^^^^^^^^
.. figure:: ../api/images/sensor_colordistance.png
:width: 35 %
.. autoclass:: pybricks.pupdevices.ColorDistanceSensor
:no-members:
.. automethod:: pybricks.pupdevices.ColorDistanceSensor.color
.. automethod:: pybricks.pupdevices.ColorDistanceSensor.ambient
.. automethod:: pybricks.pupdevices.ColorDistanceSensor.reflection
.. automethod:: pybricks.pupdevices.ColorDistanceSensor.distance
.. automethod:: pybricks.pupdevices.ColorDistanceSensor.remote
.. rubric:: Built-in light
This sensor has a built-in light. You can make it red, green, blue, or turn
it off. If you use the sensor to measure something afterwards, the light
automatically turns back on at the default color for that sensing method.
.. automethod:: pybricks.pupdevices::ColorDistanceSensor.light.on
.. automethod:: pybricks.pupdevices::ColorDistanceSensor.light.off
.. Tilt Sensor
.. ^^^^^^^^^^^^^^^^^^^^^^^^^
.. .. autoclass:: pybricks.pupdevices.TiltSensor
:no-members:
.. automethod:: neutral
.. automethod:: acceleration
.. automethod:: tilt
.. automethod:: up
.. Remote Control
.. ^^^^^^^^^^^^^^^^^^^^^^^^^
.. .. autoclass:: pybricks.pupdevices.RemoteControl
:no-members:
.. automethod:: pybricks.pupdevices::RemoteControl.light.on
.. automethod:: pybricks.pupdevices::RemoteControl.light.off
.. automethod:: pybricks.pupdevices::RemoteControl.buttons.pressed
-12
View File
@@ -1,12 +0,0 @@
EV3 Quick Start
########################
.. include:: start_ev3_install.inc
.. include:: start_ev3_brick.inc
.. include:: start_ev3_run.inc
.. include:: start_ev3_linux.inc
.. include:: start_ev3_upgrade.inc
-81
View File
@@ -1,81 +0,0 @@
Using the EV3 Brick
===================
Make sure the EV3 Brick is turned off. Insert the microSD card you prepared
into the microSD card slot on the EV3 Brick, as shown in :numref:`fig_sd`.
.. _fig_sd:
.. figure:: ../api/images/sd_label.png
:width: 75 %
:alt: sd
:align: center
Inserting the flashed microSD card into the EV3 Brick
Turning the EV3 Brick on and off
-----------------------------------------------------------
Turn on the EV3 Brick by pressing the dark gray center button.
The boot process may take several minutes. While booting, the EV3 Brick status
light turns orange and blinks intermittently, and you'll see a lot of text on
the EV3 screen. The EV3 Brick is ready for use when the status light turns
green.
To turn the EV3 Brick off, open the shutdown menu with the back button, and
then select *Power Off* using the center button, as shown
in :numref:`fig_onoff`.
.. _fig_onoff:
.. figure:: ../api/images/onoff_label.png
:width: 65 %
:alt: onoff
:align: center
Turning the EV3 Brick off
Viewing motor and sensor values
-----------------------------------------------------------
When you're not running a program, you can view motor and sensor values using
the device browser, as shown in :numref:`fig_devicebrowser`.
.. _fig_devicebrowser:
.. figure:: ../api/images/devicebrowser_label.png
:width: 100 %
:alt: devicebrowser
:align: center
Viewing motor and sensor values
Running a program without a computer
-----------------------------------------------------------
You can run previously downloaded programs directly from the EV3 Brick.
To do so, find the program using the *file browser* on the EV3 screen and press
the center button key to start the program as shown in :numref:`fig_manualrun`.
.. _fig_manualrun:
.. figure:: ../api/images/manualrun_label.png
:width: 100 %
:alt: manualrun
:align: center
Starting a program using the buttons on the EV3 Brick
Going back to the original firmware
-----------------------------------------------------------
You can go back to the LEGO® firmware and your LEGO programs at any time. To
do so:
1. Turn the EV3 Brick off as shown above.
2. Wait for the screen and brick status light to turn off.
3. Remove the microSD card.
4. Turn the EV3 on.
-5
View File
@@ -1,5 +0,0 @@
.. _EV3 MicroPython microSD card image: https://pybricks.com/downloads
1. Download the `EV3 MicroPython microSD card image`_ and save it in a
convenient location. This file is approximately 360 MB. You do **not** need
to unzip the file.
-115
View File
@@ -1,115 +0,0 @@
Installation
===================
This page guides you through the steps to collect and install everything you
need to start programming.
What do you need?
-----------------------------------------------------------
To get started, you'll need:
- A Windows 10 or Mac OS computer
- Internet access and administrator access
This is required during the installation only. You will not need special
access to write and run programs later on.
- A microSD card
You'll need a card with a minimum capacity of 4GB and a maximum capacity
of 32GB. This type of microSD card is also known as microSDHC. We recommend
cards with Application Performance Class A1.
- A microSD card slot or card reader in your computer
If your computer does not have a (micro)SD card slot, you can use an
external USB (micro)SD card reader.
- A mini-USB cable, like the one included with your EV3 set
The typical configuration of this equipment is summarized
in :numref:`fig_overview`.
.. _fig_overview:
.. figure:: ../api/images/overview_label.png
:width: 90 %
:alt: overview
:align: center
Setup overview
Preparing your computer
-----------------------------------------------------------
You'll write your MicroPython programs using Visual Studio Code. Follow the
steps below to download, install, and configure this application:
1. Download `Visual Studio Code <https://code.visualstudio.com/Download>`_.
2. Follow the on-screen instructions to install the application.
3. Launch Visual Studio Code.
4. Open the extensions tab.
5. Install the EV3 MicroPython extension as shown in :numref:`fig_store`.
.. _fig_store:
.. figure:: ../api/images/store_label.png
:alt: store
:align: center
Installing the extension from the Visual Studio Code marketplace
.. _prepsdcard:
Preparing the microSD card
-----------------------------------------------------------
To make it possible to run MicroPython programs on your EV3 Brick, you'll now
learn how to install the required tools on your microSD card.
If the microSD card contains files you want to keep, make sure to create a
backup of its contents first.
See :ref:`managing files on the EV3 <managefiles>` to learn how to backup your
previous MicroPython programs if necessary.
*This process erases everything on your microSD card, including any previous
MicroPython programs on it.*
To install the MicroPython tools on your microSD card:
.. include:: start_ev3_download.inc
2. Download and install a microSD card flashing tool
such as `Etcher <https://www.balena.io/etcher/>`_.
3. Insert the microSD card into your computer or card reader.
4. Launch the flashing tool and follow the steps on your screen to install
the file you have just downloaded. If you use Etcher, you can follow the
instructions below, as shown in :numref:`fig_etcher`.
a. Select the EV3 MicroPython microSD card image file you have just
downloaded.
b. Select your microSD card. Make sure that the device and size correspond
to your microSD card.
c. Start the flashing process. This may take several minutes. Do not remove
the card until the flashing process is complete.
.. _fig_etcher:
.. figure:: ../api/images/etcher_label.png
:width: 85 %
:alt: etcher
:align: center
Using Etcher to flash the EV3 MicroPython microSD card image
Updating the microSD card
-----------------------------------------------------------
To update the microSD card, download a new image file using the link above and
flash it to the microSD card as described above. Be sure
to :ref:`back up any MicroPython programs you want to save <managefiles>`.
You do not need to erase the contents of the microSD card first. This is done
automatically when you flash the new image file.
-110
View File
@@ -1,110 +0,0 @@
Accessing advanced EV3 features
===============================
MicroPython runs on top of `ev3dev`_, which is a specific version of Linux.
Linux is an *operating system*. (Other popular operating
systems are Microsoft Windows and Apple macOS.) This means that your EV3 is
almost like a real computer, just much smaller.
.. note::
*If you just want to write MicroPython programs, you can skip the
remaining sections.*
The remaining sections are aimed at curious users who want go beyond
MicroPython and access some of the other built-in features of Linux and
ev3dev.
The Linux command line
-----------------------------------------
Although your EV3 Brick is quite like a real computer, you do not interact with
it using a big screen and a mouse. Instead, you can access files and programs
on it using the *command line*. It is also called the *terminal*.
Follow the steps in :numref:`fig_terminal` to access the command line. Now
you can enter commands by typing them in and pressing enter.
.. _fig_terminal:
.. figure:: ../api/images/terminal_label.png
:width: 100 %
:alt: files
:align: center
Opening the Linux command line and running the ``ls`` command.
**Running basic commands**
For example, if you type the following command and press enter::
ls
then you will see the contents of the current folder. :numref:`fig_terminal`
shows the result: it listed the project folder of the ``getting_started``
project that we just ran.
If you type the following command and press enter::
exit
then the command line will be closed. Alternatively, click the garbage icon
shown in :numref:`fig_terminal`.
You can copy text from the command line by selecting it and
then pressing ``ctrl`` ``shift`` ``c``.
You can paste text into the command line
using ``ctrl`` ``shift`` ``v``.
**Running commands as an administrator**
Some commands require a password to run. This is similar to administrative
tasks on your computer or tablet, such as installing a new app. These commands
work like any other command, but you add ``sudo`` in front of
them.
As an exercise, you can run the following command to turn the EV3 Brick off::
sudo poweroff
You will be prompted for a password. Type ``maker`` and then press ``Enter``.
.. warning::
Only run commands with ``sudo`` if you know what you are doing.
**Learning more about the command line**
To learn more about the command line and many of the available commands, we
recommend reading the beginner-friendly free ebook
called `The Linux Command Line`_.
To learn more about ev3dev-specific tips and tricks, visit the `ev3dev`_
website.
.. _hostname:
Changing the EV3 Brick name
-----------------------------------------------------------
When you search for your EV3 using Visual Studio Code, you see all EV3 Bricks
listed by their name. By default, all EV3 Bricks are named *ev3dev*. Follow
these steps to change that name:
1. Open Visual Studio Code and connect to your EV3 as usual.
2. Read the steps above about running commands as an administrator.
3. Think of a good name. In this example, we'll
call it ``autonomous-vehicle2``
4. Enter the following command and press enter::
sudo hostnamectl set-hostname autonomous-vehicle2
5. Reboot the EV3 Brick for the change to take effect.
6. You may need to reboot your computer as well.
EV3 Brick names should only contain lowercase letters ``a`` through ``z``,
the digits ``0`` through ``9``, and the hyphen ``-``. It must start with a
letter or digit. It cannot include spaces or other symbols.
.. _ev3dev: https://www.ev3dev.org/
.. _The Linux Command Line: http://linuxcommand.org/tlcl.php
-166
View File
@@ -1,166 +0,0 @@
Creating and running programs
=============================
Now that you've set up your computer and EV3 Brick, you're ready to start
writing programs.
To make it easier to create and manage your programs, let's first have a quick
look at how MicroPython projects and programs for your EV3 robots are
organized.
Programs are organized into *project folders*, as shown in
:numref:`fig_projectstructure`. A project folder is a directory on your
computer that contains the main program (**main.py**) and other optional
scripts or files. This project folder and all of its contents will be copied
to the EV3 Brick, where the main program will be run.
This page shows you how to create such a project and how to transfer it to the
EV3 Brick.
.. _fig_projectstructure:
.. figure:: ../api/images/projectstructure_label.png
:width: 100 %
:alt: projectstructure
:align: center
A project contains a program called **main.py** and optional resources like
sounds or MicroPython modules.
Creating a new project
-----------------------------------------------------------
To create a new project, open the EV3 MicroPython tab and
click *create a new project*, as shown in :numref:`fig_newproject`. Enter a
project name in the text field that appears and press *Enter*. When prompted,
choose a location for this program and confirm by clicking *choose folder*.
.. _fig_newproject:
.. figure:: ../api/images/newproject_label.png
:width: 100 %
:alt: newproject
:align: center
Creating a new project. This example is called *getting_started*, but you
can choose any name.
When you create a new project, it already includes a file called *main.py*. To
see its contents and to modify it, open it from the file browser as shown in
:numref:`fig_projectoverview`. This is where you'll write your programs.
If you are new to MicroPython programming, we recommend that you keep the
existing code in place and add your code to it.
.. _fig_projectoverview:
.. figure:: ../api/images/projectoverview_label.png
:width: 100 %
:alt: projectoverview
:align: center
Opening the default *main.py* program.
Opening an existing project
-----------------------------------------------------------
To open a project you created previously, click *File* and click
*Open Folder*, as shown in :numref:`fig_existingproject`. Next, navigate to
your previously created project folder and click *OK*. You can also open your
recently used projects using the *Open Recent* menu option.
.. _fig_existingproject:
.. figure:: ../api/images/existingproject_label.png
:width: 75 %
:alt: existingproject
:align: center
Opening a previously created project.
Connecting to the EV3 Brick with Visual Studio Code
-----------------------------------------------------------
To be able to transfer your code to the EV3 Brick, you'll first need to
connect the EV3 Brick to your computer with the mini-USB cable and configure
the connection with Visual Studio Code. To do so:
- Turn the EV3 Brick on
- Connect the EV3 Brick to your computer with the mini-USB cable
- Configure the USB connection as shown in :numref:`fig_connecting`.
.. _fig_connecting:
.. figure:: ../api/images/connecting_label.png
:width: 100 %
:alt: connecting
:align: center
Configuring the USB connection between the computer and the EV3 Brick
Downloading and running a program
-----------------------------------------------------------
You can press the F5 key to run the program. Alternatively, you can start it
manually by going to the *debug* tab and clicking the green start arrow, as
shown in :numref:`fig_running`.
When the program starts, a pop-up toolbar allows you to stop the program if
necessary. You can also stop the program at any time using the back button on
the EV3 Brick.
If your program produces any output with the ``print`` command, this is shown
in the output window.
.. _fig_running:
.. figure:: ../api/images/running_label.png
:width: 100 %
:alt: running
:align: center
Running a program
Expanding the example program
-----------------------------------------------------------
Now that you've run the basic code template, you can expand the program to
make a motor move. First, attach a Large Motor to Port B on the EV3 Brick,
as shown in :numref:`fig_firstprogram`.
.. _fig_firstprogram:
.. figure:: ../api/images/firstprogram_label.png
:width: 100 %
:alt: firstprogram
:align: center
The EV3 Brick with a Large Motor attached to port B.
Next, edit *main.py* to make it look like this:
.. literalinclude::
../../pybricks-projects/snippets/ev3/getting_started/main.py
This program makes your robot beep, rotate the motor, and beep again with a
higher pitched tone. Run the program to make sure that it works as expected.
.. _managefiles:
Managing files on the EV3 Brick
-----------------------------------------------------------
After you've downloaded a project to the EV3 Brick, you can run, delete, or
back up programs stored on it using the device browser as shown in
:numref:`fig_files`.
.. _fig_files:
.. figure:: ../api/images/files_label.png
:width: 100 %
:alt: files
:align: center
Using the EV3 device browser to manage files on your EV3 Brick
-248
View File
@@ -1,248 +0,0 @@
Upgrading from v1.0 to v2.0
===============================
*EV3 MicroPython version 2.0 was released on May 18, 2020.*
This section is for users who have previously used LEGO MINDSTORMS EV3
MicroPython v1.0. We'll explain what's changed and how you can upgrade to
benefit from the latest improvements.
If you are a new user and you just got started using version 2.0, you may skip
this section.
Upgrading the microSD Card
-----------------------------------------
To upgrade, download the latest microSD card file and install it using the
standard :ref:`instructions <prepsdcard>`.
Note that this will erase all your existing files on the SD Card. Before you
upgrade, make sure that you still have all your projects on your computer.
If not, you can upload files back to your computer using
:ref:`these instructions <managefiles>`.
As with any software update, *be careful about when you update*. For example,
if you developed your code using version v1.0 and you are halfway into your
robotics competition season, you may want to stick with v1.0 for now.
Upgrading your existing programs
-----------------------------------------
Most changes in v2.0 are *new* features, like support for additional sensors.
Naturally, this will not affect your existing code.
However, some changes were made to existing features to improve performance.
All originally documented features in v1.0 will still work after you upgrade.
This means that most programs originally made for v1.0 will work with the v2.0
microSD card image without any changes.
To try this, simply download and run your original code as you did before.
However, it is recommended that you upgrade both the microSD card and your
programs at the same time to ensure everything works as expected.
The new EV3Brick() class replaces the ev3brick module
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Version 2.0 introduces the :class:`EV3Brick() <pybricks.hubs.EV3Brick>` class.
You can use it instead of the old ``ev3brick`` module. The old ``ev3brick``
module can still be used, but it is no longer recommended or documented.
The :class:`EV3Brick() <pybricks.hubs.EV3Brick>` class improves the speed and
reliability of the EV3 screen and the EV3 speaker. It also adds functionality
like speech and drawing shapes. The default
font size is also bigger to make it easier to read text on the screen.
You can use
the following table as a starting point to upgrade your scripts. See the
:class:`EV3Brick() <pybricks.hubs.EV3Brick>` class documentation for
complete details of all methods and arguments.
.. list-table::
* - **Action**
- **v1.0**
- **v2.0**
* - | Initialize
| your EV3
- ::
from pybricks import ev3brick as brick
- ::
from pybricks.hubs import EV3Brick
ev3 = EV3Brick()
* - | Light on
- ::
brick.light(Color.RED)
- ::
ev3.light.on(Color.RED)
* - | Light off
- ::
brick.light(None)
- ::
ev3.light.off()
* - | Read
| Buttons
- ::
if Button.LEFT in brick.buttons():
print("Left is pressed.")
- ::
if Button.LEFT in ev3.buttons.pressed():
print("Left is pressed.")
* - | Play a
| beep
- ::
brick.sound.beep()
- ::
ev3.speaker.beep()
* - | Play a
| sound file
- ::
brick.sound.file(SoundFile.HELLO)
- ::
ev3.speaker.play_file(SoundFile.HELLO)
* - | Text to
| speech
-
- ::
ev3.speaker.say("I can say anything!")
* - | Play
| notes
-
- ::
ev3.speaker.play_notes(['C4/4', 'G4/4'])
* - | Write text
| at a given
| position
- ::
brick.display.text("Hello!", (50, 60))
- ::
ev3.screen.draw_text(50, 60, "Hello!")
* - | Write text
| and scroll
| automatically
- ::
brick.display.text("Hello")
brick.display.text("world!")
- ::
ev3.screen.print("Hello")
ev3.screen.print("world!")
* - | Change font
| size
-
- ::
from pybricks.media.ev3dev import Font
big_font = Font(size=24)
ev3.screen.set_font(big_font)
* - | Display an
| image on
| the screen
- ::
from pybricks.parameters import ImageFile
brick.display.image(ImageFile.QUESTION_MARK)
- ::
from pybricks.media.ev3dev import ImageFile
ev3.screen.load_image(ImageFile.Question_MARK)
* - | Draw shapes
| on the screen
-
- ::
ev3.screen.draw_line(30, 30, 30, 100)
ev3.screen.draw_box(50, 30, 90, 60)
ev3.screen.draw_circle(70, 90, 20, fill=True)
* - | Read
| battery
| voltage
- ::
brick.battery.voltage()
- ::
ev3.battery.voltage()
Other internal changes to existing features
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Most methods of the :class:`Motor() <pybricks.ev3devices.Motor>` class now
have ``Stop.HOLD`` as the default instead of ``Stop.COAST``. This improves
accuracy in most applications. You can still select ``Stop.COAST`` if you
like.
- The internal PID controllers for the motors are more accurate than before.
If you give a motor command when it is already running, it smoothly adjusts
the speed to the newly given command. This works even if you keep
adjusting the speed in a fast loop.
- Methods to configure motor settings have changed. You can change settings
using the :doc:`control <motors>` attribute now. The old settings setters
continue to exist in the implementation, but they are no longer documented.
- So-called Python *keyword arguments* are now supported. Previously, you
could only enter the argument *values*. For example:
::
my_motor.run_angle(500, 90, Stop.HOLD, False)
This is still possible. But you can now choose to omit optional arguments
and specify others with *keywords*. This can make your code easier to read.
For example:
::
my_motor.run_angle(500, 90, wait=False)
- It is no longer necessary to import ``pybricks.tools.print``. The ``print``
function is now built-in. It works just like Python or MicroPython.
- Most parameters in the :mod:`parameters <pybricks.parameters>` now have a
specific type and representation. For example, suppose you measure a color
and print the result. If you do ``print(Color.RED)``, you will see the
parameter instead of a technical number.
- Sound and image files have moved to a dedicated :doc:`media <media>` module.
Importing them from the old location will continue to work in this release,
to make sure existing scripts will still work.
**Installing an older version of the Visual Studio Code extension**
The Visual Studio Code extension and this documentation are updated
automatically. You can still use your existing scripts with the updated
extension. If you absolutely wish to keep the old version, look for the EV3
extension on the extension tab, click the gear icon, and
click *install another version*.
-4
View File
@@ -1,4 +0,0 @@
Powered Up Quick Start
########################
Coming soon!
-89
View File
@@ -1,89 +0,0 @@
:mod:`tools <pybricks.tools>` -- Timing and Data logging
========================================================
.. automodule:: pybricks.tools
:no-members:
.. autofunction:: wait
.. autoclass:: pybricks.tools.StopWatch
:no-members:
.. automethod:: pybricks.tools.StopWatch.time
.. automethod:: pybricks.tools.StopWatch.pause
.. automethod:: pybricks.tools.StopWatch.resume
.. automethod:: pybricks.tools.StopWatch.reset
.. autoclass:: pybricks.tools.DataLog
:no-members:
.. automethod:: pybricks.tools.DataLog.log
By default, this class creates a ``csv`` file on the EV3 brick with the
name ``log`` and the current date and time. For example, if you
use this class on 13 February 2020 on 10:07 and 44.431260
seconds, the file is called ``log_2020_02_13_10_07_44_431260.csv``.
See :ref:`managing files on the EV3 <managefiles>` to learn how to upload
the log file back to your computer.
.. toggle-header::
:header: **Show/hide example: Logging and visualizing measurements**
**Example**
This example shows how to log the angle of a rotating wheel as time passes.
.. literalinclude:: ../../pybricks-projects/snippets/ev3/datalog/main.py
In this example, the generated file has the following contents::
time, angle
3, 0
108, 6
212, 30
316, 71
419, 124
523, 176
628, 228
734, 281
838, 333
942, 385
When you upload the file to your computer as shown above, you can open it
in a spreadsheet editor. You can then generate a graph of the data, as
shown in :numref:`fig_datalog_graph`.
In this example, we see that the motor angle changes slowly at first. Then
the angle begins to change faster, and the graph becomes a straight line.
This means that the motor has reached a constant speed. You can verify that
the angle increases by 500 degrees per second.
.. _fig_datalog_graph:
.. figure:: ../api/images/datalog_graph.png
:width: 100 %
Original file contents (left) and a generated graph (right).
.. toggle-header::
:header: **Show/hide example: Using the optional arguments**
**Example**
This example shows how to log data beyond just numbers. It also shows how
you can use the optional arguments of the ``DataLog`` class to choose the
file name and extension.
In this example, ``timestamp=False``, which means that the date and time
are not added to the file name. This can be convenient because the file
name will always be the same. However, this means that the contents of
``my_file.txt`` will be overwritten every time you run this script.
.. literalinclude:: ../../pybricks-projects/snippets/ev3/datalog_extra/main.py
+42
View File
@@ -0,0 +1,42 @@
/* These styles only apply to the ide build */
.wy-breadcrumbs li.wy-breadcrumbs-aside {
display: none;
}
/* Scrollbar styling to match Pybricks Code. */
/* https://github.com/pybricks/pybricks-code/blob/master/src/index.scss */
::-webkit-scrollbar {
width: 16px;
}
.bp3-dark ::-webkit-scrollbar-track {
background: #293742;
}
::-webkit-scrollbar-track {
background: #e8e8e8;
}
.bp3-dark ::-webkit-scrollbar-thumb {
border-color: #293742;
background: #a7b6c2;
}
::-webkit-scrollbar-thumb {
border-width: 3px;
border-style: solid;
border-radius: 8px;
border-color: #e8e8e8;
background: #5c7080;
}
.bp3-dark ::-webkit-scrollbar-thumb:hover {
background: #f5f8fa;
}
::-webkit-scrollbar-thumb:hover {
background: #182026;
}
+6 -11
View File
@@ -26,17 +26,6 @@ span.caption-number:after {
margin-bottom: 24px !important;
}
/*
sphinx-contrib contentui sets max-width to none,
giving a very wide page which makes text hard to
read. This sets it to a finite value.
*/
@media screen and (min-width: 1300px) {
.wy-nav-content {
max-width: 800px;
}
}
/* decorate external links in navigation side bar */
.wy-nav-side a.reference.external:after {
font-family: FontAwesome;
@@ -46,3 +35,9 @@ span.caption-number:after {
font-size: 60%;
margin: 0 0.2em;
}
/* don't show external link on figures */
/* https://github.com/readthedocs/sphinx_rtd_theme/pull/494#issuecomment-354063112 */
.figure > a.reference.external::after {
content: none !important;
}
+5
View File
@@ -0,0 +1,5 @@
// Since Pybricks Code is an "app", all external links get opened in new tab/window
// https://stackoverflow.com/a/62742435/1976323
$(document).ready(function () {
$('a[href^="http://"], a[href^="https://"]').not('a[class*=internal]').attr('target', '_blank');
});
+1 -1
View File
@@ -1,5 +1,5 @@
{% extends '!footer.html' %}
{% block extrafooter %}
<div class="disclaimer">{{ disclaimer }}</div>
{% if disclaimer %}<div class="disclaimer">{{ disclaimer }}</div>{% endif %}
{% endblock %}
+151 -123
View File
@@ -20,27 +20,24 @@
# flake8: noqa
import os
import re
import sys
from docutils import nodes
from docutils.parsers.rst.directives import flag
from docutils.parsers.rst import Directive
from sphinx.application import Sphinx
from sphinx.domains.python import PyClassmember, PythonDomain
import toml
TOP_DIR = os.path.abspath(os.path.join('..', '..'))
sys.path.insert(0, TOP_DIR)
from pybricks.hubs import EV3Brick # noqa E402
from pybricks.media.ev3dev import Image # noqa E402
from pybricks._common import Speaker # noqa E402
TOP_DIR = os.path.abspath(os.path.join("..", ".."))
sys.path.insert(0, os.path.join(TOP_DIR, "src"))
sys.path.append(os.path.abspath("../common/extensions"))
# ON_RTD is whether we are on readthedocs.org
# this line of code grabbed from docs.readthedocs.org
ON_RTD = os.environ.get('READTHEDOCS', None) == 'True'
ON_RTD = os.environ.get("READTHEDOCS", None) == "True"
_pyproject = toml.load(os.path.join(TOP_DIR, 'pyproject.toml'))
_pyproject = toml.load(os.path.join(TOP_DIR, "pyproject.toml"))
# -- General configuration ------------------------------------------------
@@ -52,43 +49,48 @@ _pyproject = toml.load(os.path.join(TOP_DIR, 'pyproject.toml'))
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
'sphinx.ext.mathjax',
'sphinxcontrib.contentui',
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.mathjax",
# Custom Pybricks extensions
"color",
"classlink",
"requirements",
"requirements-static",
"versionchanged",
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['../common/_templates']
templates_path = ["../common/_templates"]
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"
# The master toctree document.
master_doc = 'index'
master_doc = "index"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = _pyproject["tool"]["poetry"]["version"]
# The full version, including alpha/beta/rc tags.
release = version
release = "v" + _pyproject["tool"]["poetry"]["version"]
# The short X.Y version.
version = re.match(r"(v\d+\.\d+)", release)[0]
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "xcode"
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
@@ -96,10 +98,10 @@ todo_include_todos = True
# Figure numbering
numfig = True
numfig_format = {
'figure': 'Figure %s',
'table': 'Table %s',
'code-block': 'Listing %s',
'section': 'Section %s'
"figure": "Figure %s",
"table": "Table %s",
"code-block": "Listing %s",
"section": "Section %s",
}
# Find cross-reference errors
@@ -107,42 +109,49 @@ nitpicky = True
# https://stackoverflow.com/a/30624034/1976323
nitpick_ignore = [
('py:class', 'bool'),
('py:class', 'bytearray'),
('py:class', 'bytes'),
('py:class', 'callable'),
('py:class', 'dict'),
('py:class', 'float'),
('py:class', 'int'),
('py:class', 'iter'),
('py:class', 'list'),
('py:class', 'object'),
('py:class', 'str'),
('py:class', 'tuple'),
('py:exc', 'OSError'),
('py:exc', 'RuntimeError'),
('py:exc', 'TypeError'),
('py:exc', 'ValueError'),
("py:class", "bool"),
("py:class", "bytearray"),
("py:class", "bytes"),
("py:class", "callable"),
("py:class", "dict"),
("py:class", "float"),
("py:class", "int"),
("py:class", "iter"),
("py:class", "list"),
("py:class", "object"),
("py:class", "str"),
("py:class", "tuple"),
("py:exc", "OSError"),
("py:exc", "RuntimeError"),
("py:exc", "TypeError"),
("py:exc", "ValueError"),
]
# not sure why, but this is needed for typing.IO in uselect
nitpick_ignore.append(("py:obj", "typing.IO"))
# -- Autodoc options ------------------------------------------------------
autodoc_member_order = 'bysource'
autodoc_default_flags = ['members', 'undoc-members']
autoclass_content = 'both' # This ensures init arguments are not ignored
autodoc_member_order = "bysource"
autodoc_default_options = {
"members": True,
"undoc-members": True,
}
autoclass_content = "both" # This ensures init arguments are not ignored
add_module_names = False # Hide module name
# -- Options for HTML output ----------------------------------------------
if ON_RTD:
html_theme = 'default'
html_theme = "default"
else:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_context = {
'disclaimer': _DISCLAIMER,
"disclaimer": _DISCLAIMER,
}
# The theme to use for HTML and HTML Help pages. See the documentation for
@@ -155,14 +164,14 @@ html_context = {
# documentation.
#
html_theme_options = {
'style_external_links': True,
'logo_only': True,
"style_external_links": True,
"logo_only": True,
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['../common/_static']
html_static_path = ["../common/_static"]
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
@@ -170,9 +179,9 @@ html_static_path = ['../common/_static']
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
"**": [
"relations.html", # needs 'show_related': True theme option to display
"searchbox.html",
]
}
@@ -182,7 +191,7 @@ html_scaled_image_link = False
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'Pybricksdoc'
htmlhelp_basename = "Pybricksdoc"
# -- Options for LaTeX output ---------------------------------------------
@@ -191,14 +200,12 @@ latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
'preamble': r'''
"preamble": r"""
\usepackage{CJKutf8}
\makeatletter
\fancypagestyle{normal}{
@@ -218,34 +225,46 @@ latex_elements = {
\renewcommand{\footrulewidth}{0.4pt}
}
\makeatother
''' % {
'disclaimer': ' '.join((_DISCLAIMER, '©', copyright)),
"""
% {
"disclaimer": " ".join((_DISCLAIMER, "©", copyright)),
},
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
'extraclassoptions': 'openany,oneside',
'releasename': 'Version',
"extraclassoptions": "openany,oneside",
"releasename": "Version",
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, ''.join([project, '-v', version, '.tex']), _TITLE,
author, 'manual'),
(master_doc, "".join([project, "-v", version, ".tex"]), _TITLE, author, "manual"),
]
# -- Content control -----------------------------------------------------
exclude_patterns = [
"ev3devices.rst",
"hubs/ev3brick.rst",
"iodevices/analogsensor.rst",
"iodevices/dcmotor.rst",
"iodevices/ev3devsensor.rst",
"iodevices/i2cdevice.rst",
"iodevices/lumpdevice.rst",
"iodevices/uartdevice.rst",
"media.rst",
"messaging.rst",
"nxtdevices.rst",
"tools/datalog.rst",
]
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'pybricks', 'Pybricks Documentation',
[author], 1)
]
man_pages = [(master_doc, "pybricks", "Pybricks Documentation", [author], 1)]
# -- Options for Texinfo output -------------------------------------------
@@ -254,74 +273,83 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'Pybricks', 'Pybricks Documentation',
author, 'Pybricks', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"Pybricks",
"Pybricks Documentation",
author,
"Pybricks",
"One line description of project.",
"Miscellaneous",
),
]
# -- .. availability:: directive
class AvailabilityDirective(Directive):
has_content = True
option_spec = {
'movehub': flag,
'cityhub': flag,
'cplushub': flag,
'ev3dev-stretch': flag,
"movehub": flag,
"cityhub": flag,
"technichub": flag,
"ev3dev-stretch": flag,
}
def run(self):
if not self.options:
raise self.error('Must specify at least one platform.')
raise self.error("Must specify at least one platform.")
# TODO: make links to platform pages
return [nodes.emphasis(text='Availability: '),
nodes.Text(', '.join(self.options))]
return [
nodes.emphasis(text="Availability: "),
nodes.Text(", ".join(self.options)),
]
def on_missing_reference(app, env, node, contnode):
# References with special characters can't exist, so we have to supress
# warnings when Sphinx tries to cross reference units like deg/s. For
# consistency, we also treat units without special characters this way.
for unit in [
"deg",
"deg/s",
"deg/s²",
"mm",
"mm/s",
"mm/s²",
"%",
"mV",
"mA",
"ms",
"mNm",
"Hz",
]:
# If they match on raw source, we are dealing with argument types.
if unit == contnode.rawsource:
# Return as-is to suppress missing cross reference warning. We
# could make this more fancy by returning an xref node that links
# to the signals page.
return contnode
# Return types are denoted as "int: deg"
try:
# Try to unpack the node.
ret_type, ret_unit = str(contnode).split(": ")
except ValueError:
# Not a valid format, so skip.
continue
# If it's a match, we could format the node so it looks a bit nicer.
# For now just keep the colon notation as is.
if unit == ret_unit:
return nodes.Text(f"{ret_type}: {ret_unit}")
def setup(app: Sphinx):
app.add_directive('availability', AvailabilityDirective)
app.add_directive("availability", AvailabilityDirective)
app.connect("missing-reference", on_missing_reference)
# -- Python domain hacks ---------------------------------------------------
real_get_signature_prefix = PyClassmember.get_signature_prefix
def get_signature_prefix(self, sig):
# hacks for battery and light
if sig.count('.') >= 2:
return ''
return real_get_signature_prefix(self, sig)
PyClassmember.get_signature_prefix = get_signature_prefix
# HACK: For certain hub attributes, we list the class members of the attributes
# class as if the attribute was a nested class so that readers don't have to
# skip around the docs as much. To make this work, we replace the attribute
# values with the type and override PythonDomain.find_obj so that references
# still work.
base_find_obj = PythonDomain.find_obj
def find_obj(self, env, modname, classname, name, type, searchmode=0):
if modname == 'pybricks.hubs':
if classname == 'screen':
if name.startswith('Font.') or name == 'Font':
modname = 'pybricks.media.ev3dev'
elif name.startswith('Image.') or name == 'Image':
modname = 'pybricks.media.ev3dev'
else:
classname = 'EV3Brick.screen'
elif classname == 'speaker':
classname = 'EV3Brick.speaker'
return base_find_obj(self, env, modname, classname, name, type, searchmode)
PythonDomain.find_obj = find_obj
EV3Brick.screen = Image
EV3Brick.speaker = Speaker
+35
View File
@@ -0,0 +1,35 @@
from docutils import nodes
from docutils.parsers.rst import Directive
class PybricksClasslinkDirective(Directive):
required_arguments = 1
optional_arguments = 1
def run(self):
# Get link and name from sphinx-directive
name = self.arguments[0]
link = name if len(self.arguments) == 1 else self.arguments[1]
html = (
'<a href="{0}.html">'.format(link.lower())
+ '<dl class="py class">'
+ "<dt>"
+ '<em class="property">class </em>'
+ '<code class="sig-name descname">'
+ name
+ "</code>"
+ "</dt>"
+ "<dd></dd>"
+ "</dl>"
+ "</a>"
)
# Return the node
node = nodes.raw("", html, format="html")
return [node]
def setup(app):
app.add_directive_to_domain("py", "pybricks-classlink", PybricksClasslinkDirective)
+42
View File
@@ -0,0 +1,42 @@
from docutils import nodes
from docutils.parsers.rst import Directive
from pybricks.parameters import Color
from colorsys import hsv_to_rgb
class PybricksColorDirective(Directive):
required_arguments = 1
def run(self):
# Get color name from sphinx-directive
name = self.arguments[0]
# Get Color class attribute
color = getattr(Color, name)
# Convert HSV to RGB
r, g, b = hsv_to_rgb(color.h / 360, color.s / 100, color.v / 100)
# Convert RGB to HEX
rgbhex = "#{0:02x}{1:02x}{2:02x}".format(
round(r * 255), round(g * 255), round(b * 255)
)
# Render a small block of the given color
css = "background-color: {0}; color: {0}; width: 50px;".format(rgbhex)
if name == "WHITE":
css += (
"border-style: solid; border-width: 0.5px;" + "border-color: #666666;"
)
html = '<div id="test" style="{0}">_</div>'.format(css)
# Return the node
node = nodes.raw("", html, format="html")
return [node]
def setup(app):
app.add_directive_to_domain("py", "pybricks-color", PybricksColorDirective)
@@ -0,0 +1,102 @@
from os import path, makedirs
from docutils import nodes
from docutils.parsers.rst import Directive
from sphinx.util.osutil import copyfile
# Base feature set.
FEATURES_SMALL = set()
# Medium feature set.
FEATURES_MEDIUM = FEATURES_SMALL | {
"pybricks-geometry",
"pybricks-iodevices",
"stm32-extra",
"stm32-float",
}
# Large feature set.
FEATURES_LARGE = FEATURES_MEDIUM | set()
# Features per hub.
HUB_FEATURES = {
"movehub": {"movehub"} | FEATURES_SMALL,
"cityhub": {"cityhub"} | FEATURES_MEDIUM,
"technichub": {"technichub"} | FEATURES_MEDIUM,
"primehub": {"primehub", "inventorhub"} | FEATURES_LARGE,
"inventorhub": {"primehub", "inventorhub"} | FEATURES_LARGE,
}
class PybricksRequirementsStaticDirective(Directive):
required_arguments = 0
optional_arguments = 10
def run(self):
# Copy required resources to static
# CC BY-SA 4.0 via https://stackoverflow.com/a/63728208
env = self.state.document.settings.env
destdir = path.join(env.app.builder.outdir, "_images")
if not path.exists(destdir):
makedirs(destdir)
for hub in HUB_FEATURES:
for compat in ("true", "false"):
uri = "compat_{0}_{1}_label.png".format(hub, compat)
src_uri = path.join(env.app.builder.srcdir, "images", uri)
build_uri = path.join(env.app.builder.outdir, "_images", uri)
copyfile(src_uri, build_uri)
# Get requirements from sphinx-directive.
requirements = set(self.arguments)
# Cell with image of a hub.
hub_cell = """
<th><div class="align-default">
<img alt="" src="{0}_images/compat_{1}_{2}_label.png">
</div></th>
"""
# Determine how far up the tree we are to set correct image path.
current_document = env.docname
depth = len(current_document.split("/")) - 1
depth_path = "../" * depth
# Table row with hub images.
compat_row = "".join(
[
hub_cell.format(
depth_path, hub, "true" if requirements <= features else "false"
)
for hub, features in HUB_FEATURES.items()
]
)
# Generate full table.
html = """
<div class="wy-table-responsive">
<table class="docutils align-default">
<tbody>
<tr>
{0}
</tr>
</tbody>
</table>
</div>
""".format(
compat_row
)
# Return the node.
node = nodes.raw("", html, format="html")
return [node]
def setup(app):
app.add_directive_to_domain(
"py", "pybricks-requirements-static", PybricksRequirementsStaticDirective
)
+44
View File
@@ -0,0 +1,44 @@
/*MIT License
Copyright (c) 2017 Robert, https://github.com/ulrobix/sphinxcontrib-contentui
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. */
.toggle-header {
display: block;
float: right;
clear: both;
cursor: pointer;
}
.toggle-header p {display: inline;}
.toggle-header strong {color: #2980b9 }
.toggle-header:after {
content: "Compatibility ▼";
}
.toggle-header.open:after {
content: "▲";
}
.toggle-content {
display: none;
margin-bottom: 0px;
}
+33
View File
@@ -0,0 +1,33 @@
/*MIT License
Copyright (c) 2017 Robert, https://github.com/ulrobix/sphinxcontrib-contentui
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. */
$(function() {
/**
* Toggle logic
*/
$('.toggle-content').hide()
$('.toggle-header').click(function () {
$(this).toggleClass("open");
$(this).next('.toggle-content').toggle('400');
})
});
+79
View File
@@ -0,0 +1,79 @@
# MIT License
# Copyright (c) 2017 Robert, https://github.com/ulrobix/sphinxcontrib-requirements
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import os
from docutils.parsers.rst import Directive, directives
from docutils import nodes
from docutils.statemachine import StringList
from sphinx.util.osutil import copyfile
from sphinx.util import logging
CSS_FILE = "requirements.css"
JS_FILE = "requirements.js"
class PybricksRequirementsDirective(Directive):
has_content = True
option_spec = {"header": directives.unchanged}
required_arguments = 0
optional_arguments = 10
def run(self):
node = nodes.container()
node["classes"].append("toggle-content")
par = nodes.container()
par["classes"].append("toggle-header")
content = ".. pybricks-requirements-static:: " + " ".join(self.arguments)
self.state.nested_parse(StringList([content]), self.content_offset, node)
return [par, node]
def add_assets(app):
app.add_css_file(CSS_FILE)
app.add_js_file(JS_FILE)
def copy_assets(app, exception):
if app.builder.name not in ["html", "readthedocs"] or exception:
return
logger = logging.getLogger(__name__)
logger.info("Copying requirements stylesheet/javascript... ", nonl=True)
dest = os.path.join(app.builder.outdir, "_static", CSS_FILE)
source = os.path.join(os.path.abspath(os.path.dirname(__file__)), CSS_FILE)
copyfile(source, dest)
dest = os.path.join(app.builder.outdir, "_static", JS_FILE)
source = os.path.join(os.path.abspath(os.path.dirname(__file__)), JS_FILE)
copyfile(source, dest)
logger.info("done")
def setup(app):
app.add_directive("pybricks-requirements", PybricksRequirementsDirective)
app.connect("builder-inited", add_assets)
app.connect("build-finished", copy_assets)
+31
View File
@@ -0,0 +1,31 @@
"""This directive hides the builtin directives
* versionchanged
* versionadded
* deprecated
when building documentation with the 'ide' tag.
"""
from docutils import nodes
from docutils.parsers.rst import Directive
class PybricksVersionDirective(Directive):
has_content = True
def run(self):
html = ""
node = nodes.raw("", html, format="html")
return [node]
def setup(app):
if "ide" in app.tags.tags:
app.add_directive_to_domain(
"py", "deprecated", PybricksVersionDirective, override=True
)
app.add_directive_to_domain(
"py", "versionadded", PybricksVersionDirective, override=True
)
app.add_directive_to_domain(
"py", "versionchanged", PybricksVersionDirective, override=True
)
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

+53
View File
@@ -0,0 +1,53 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Pybricks documentation build configuration file
#
import os
# General information about the project.
project = "pybricks"
copyright = "2018-2021 The Pybricks Authors"
author = ""
_TITLE = "Pybricks Modules and Examples"
_DISCLAIMER = "LEGO, the LEGO logo, MINDSTORMS and the MINDSTORMS EV3 logo are\
trademarks and/or copyrights of the LEGO Group of companies \
which does not sponsor, authorize or endorse this site."
html_favicon = "../common/images/favicon.ico"
html_logo = "../common/images/pybricks-logo-rtd.png"
latex_logo = "../common/images/pybricks-logo-large.png"
# Build main docs for RTD by default.
# Since tags cannot be passed via the TAG make variable on read the docs,
# add it manually.
if os.environ.get("READTHEDOCS", None) == "True":
tags.add("main") # noqa F821
# On https://docs.pybricks.com/en/latest/, show features tagged as beta.
if os.environ.get("READTHEDOCS_VERSION_NAME", None) == "latest":
tags.add("beta") # noqa F821
# Addtional configuration of the IDE docs
if "ide" in tags.tags: # noqa F821
_DISCLAIMER = ""
html_show_copyright = False
html_show_sphinx = False
html_css_files = ["css/ide.css"]
html_js_files = ["js/ide.js"]
imgmath_image_format = "svg"
imgmath_use_preview = True # requires Sphinx v3
imgmath_latex_preamble = r"""
\usepackage{newtxsf}
"""
exec(open(os.path.abspath("../common/conf.py")).read())
# Addtional configuration of the IDE docs
if "ide" in tags.tags: # noqa F821
extensions.remove("sphinx.ext.mathjax") # noqa F821
extensions.append("sphinx.ext.imgmath") # noqa F821
html_theme_options["prev_next_buttons_location"] = None # noqa F821

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="150"
height="135"
viewBox="0 0 39.687499 35.718751"
version="1.1"
id="svg887"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="compat_cityhub_false.svg">
<defs
id="defs881">
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1545">
<rect
style="fill:#fe2020;fill-opacity:0.48022599;stroke:none;stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect1547"
width="39.6875"
height="35.71875"
x="-25.390602"
y="312.93103" />
</clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#fcfcfc"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="1"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="10.681815"
inkscape:cy="89.597718"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1172"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:snap-global="false" />
<metadata
id="metadata884">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-261.28123)">
<rect
style="fill:#fcfcfc;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect819"
width="39.6875"
height="35.71875"
x="3.5527137e-15"
y="261.28122" />
<image
sodipodi:absref="../images/cityhub.png"
xlink:href="../images/cityhub.png"
style="stroke-width:5.6583333"
width="30.908323"
height="31.75"
preserveAspectRatio="none"
id="image1470"
x="5.2042809"
y="263.16479" />
<g
id="g862"
transform="matrix(0.84064533,0,0,0.84993509,-12.416361,243.07822)"
style="stroke-width:1.18304348">
<path
inkscape:connector-curvature="0"
id="path856"
d="m 51.33389,24.998882 5.622395,5.622396"
style="fill:none;stroke:#e2302f;stroke-width:1.18304348;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
style="fill:none;stroke:#e2302f;stroke-width:1.18304348;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 56.956285,24.998882 51.33389,30.621278"
id="path858"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="150"
height="135"
viewBox="0 0 39.687499 35.718751"
version="1.1"
id="svg887"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="compat_cityhub_true.svg">
<defs
id="defs881">
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1545">
<rect
style="fill:#fe2020;fill-opacity:0.48022599;stroke:none;stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect1547"
width="39.6875"
height="35.71875"
x="-25.390602"
y="312.93103" />
</clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#fcfcfc"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="1"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="10.681815"
inkscape:cy="89.597718"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1172"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:snap-global="false" />
<metadata
id="metadata884">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-261.28123)">
<rect
style="fill:#fcfcfc;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect819"
width="39.6875"
height="35.71875"
x="4.4408921e-16"
y="261.28122" />
<image
sodipodi:absref="../images/cityhub.png"
xlink:href="../images/cityhub.png"
style="stroke-width:5.6583333"
width="30.908323"
height="31.75"
preserveAspectRatio="none"
id="image1470"
x="5.2042809"
y="263.16479" />
<path
style="fill:none;stroke:#84ba4c;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 31.147057,265.82725 1.011052,2.9815 3.622948,-4.60003"
id="path854"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="150"
height="135"
viewBox="0 0 39.687499 35.718751"
version="1.1"
id="svg887"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="compat_inventorhub_false.svg">
<defs
id="defs881">
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1545">
<rect
style="fill:#fe2020;fill-opacity:0.48022599;stroke:none;stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect1547"
width="39.6875"
height="35.71875"
x="-25.390602"
y="312.93103" />
</clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#fcfcfc"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="1"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="10.681815"
inkscape:cy="89.597718"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1172"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:snap-global="false" />
<metadata
id="metadata884">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-261.28123)">
<rect
style="fill:#fcfcfc;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect819"
width="39.6875"
height="35.71875"
x="0"
y="261.28122" />
<image
sodipodi:absref="../images/inventorhub.png"
xlink:href="../images/inventorhub.png"
style="stroke-width:5.92592621"
width="34.915073"
height="35.71875"
preserveAspectRatio="none"
id="image1481"
x="2.6458333"
y="261.28122" />
<g
id="g862"
transform="matrix(0.84064533,0,0,0.84993509,-12.416361,243.07822)"
style="stroke-width:1.18304348">
<path
inkscape:connector-curvature="0"
id="path856"
d="m 51.33389,24.998882 5.622395,5.622396"
style="fill:none;stroke:#e2302f;stroke-width:1.18304348;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
style="fill:none;stroke:#e2302f;stroke-width:1.18304348;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 56.956285,24.998882 51.33389,30.621278"
id="path858"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="150"
height="135"
viewBox="0 0 39.687499 35.718751"
version="1.1"
id="svg887"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="compat_inventorhub_true.svg">
<defs
id="defs881">
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1545">
<rect
style="fill:#fe2020;fill-opacity:0.48022599;stroke:none;stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect1547"
width="39.6875"
height="35.71875"
x="-25.390602"
y="312.93103" />
</clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#fcfcfc"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="1"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="10.681815"
inkscape:cy="89.597718"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1172"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:snap-global="false" />
<metadata
id="metadata884">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-261.28123)">
<rect
style="fill:#fcfcfc;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect819"
width="39.6875"
height="35.71875"
x="3.5527137e-15"
y="261.28122" />
<image
sodipodi:absref="../images/inventorhub.png"
xlink:href="../images/inventorhub.png"
style="stroke-width:5.92592621"
width="34.915073"
height="35.71875"
preserveAspectRatio="none"
id="image1481"
x="2.6458333"
y="261.28122" />
<path
style="fill:none;stroke:#84ba4c;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 31.147057,265.82725 1.011052,2.9815 3.622948,-4.60003"
id="path854"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="150"
height="135"
viewBox="0 0 39.687499 35.718751"
version="1.1"
id="svg887"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="compat_movehub_false.svg">
<defs
id="defs881">
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1545">
<rect
style="fill:#fe2020;fill-opacity:0.48022599;stroke:none;stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect1547"
width="39.6875"
height="35.71875"
x="-25.390602"
y="312.93103" />
</clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#fcfcfc"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="1"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="10.681815"
inkscape:cy="89.597718"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1172"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:snap-global="false" />
<metadata
id="metadata884">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-261.28123)">
<rect
style="fill:#fcfcfc;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect819"
width="39.6875"
height="35.71875"
x="3.5527137e-15"
y="261.28122" />
<image
sodipodi:absref="../images/movehub.png"
xlink:href="../images/movehub.png"
transform="translate(25.390602,-51.6498)"
clip-path="url(#clipPath1545)"
style="stroke-width:5.92592621"
width="40.183594"
height="35.71875"
preserveAspectRatio="none"
id="image1492"
x="-25.506657"
y="312.93103" />
<g
id="g862"
transform="matrix(0.84064533,0,0,0.84993509,-12.416361,243.07822)"
style="stroke-width:1.18304348">
<path
inkscape:connector-curvature="0"
id="path856"
d="m 51.33389,24.998882 5.622395,5.622396"
style="fill:none;stroke:#e2302f;stroke-width:1.18304348;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
style="fill:none;stroke:#e2302f;stroke-width:1.18304348;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 56.956285,24.998882 51.33389,30.621278"
id="path858"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="150"
height="135"
viewBox="0 0 39.687499 35.718751"
version="1.1"
id="svg887"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="compat_movehub_true.svg">
<defs
id="defs881">
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1545">
<rect
style="fill:#fe2020;fill-opacity:0.48022599;stroke:none;stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect1547"
width="39.6875"
height="35.71875"
x="-25.390602"
y="312.93103" />
</clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#fcfcfc"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="1"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="69.775738"
inkscape:cy="79.243654"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1172"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:snap-global="false" />
<metadata
id="metadata884">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-261.28123)">
<rect
style="fill:#fcfcfc;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect819"
width="39.6875"
height="35.71875"
x="7.1054274e-15"
y="261.28122" />
<image
sodipodi:absref="../images/movehub.png"
xlink:href="../images/movehub.png"
transform="translate(25.390602,-51.6498)"
clip-path="url(#clipPath1545)"
style="stroke-width:5.92592621"
width="40.183594"
height="35.71875"
preserveAspectRatio="none"
id="image1492"
x="-25.506657"
y="312.93103" />
<path
style="fill:none;stroke:#84ba4c;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 31.147057,265.82725 1.011052,2.9815 3.622948,-4.60003"
id="path854"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="150"
height="135"
viewBox="0 0 39.687499 35.718751"
version="1.1"
id="svg887"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="compat_primehub_false.svg">
<defs
id="defs881">
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1545">
<rect
style="fill:#fe2020;fill-opacity:0.48022599;stroke:none;stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect1547"
width="39.6875"
height="35.71875"
x="-25.390602"
y="312.93103" />
</clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#fcfcfc"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="1"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="10.681815"
inkscape:cy="89.597718"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1172"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:snap-global="false" />
<metadata
id="metadata884">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-261.28123)">
<rect
style="fill:#fcfcfc;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect819"
width="39.6875"
height="35.71875"
x="0"
y="261.28122" />
<image
sodipodi:absref="../images/primehub.png"
xlink:href="../images/primehub.png"
style="stroke-width:5.92592621"
width="34.915073"
height="35.71875"
preserveAspectRatio="none"
id="image1503"
x="2.6458333"
y="261.28122" />
<g
id="g862"
transform="matrix(0.84064533,0,0,0.84993509,-12.416361,243.07822)"
style="stroke-width:1.18304348">
<path
inkscape:connector-curvature="0"
id="path856"
d="m 51.33389,24.998882 5.622395,5.622396"
style="fill:none;stroke:#e2302f;stroke-width:1.18304348;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
style="fill:none;stroke:#e2302f;stroke-width:1.18304348;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 56.956285,24.998882 51.33389,30.621278"
id="path858"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="150"
height="135"
viewBox="0 0 39.687499 35.718751"
version="1.1"
id="svg887"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="compat_primehub_true.svg">
<defs
id="defs881">
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1545">
<rect
style="fill:#fe2020;fill-opacity:0.48022599;stroke:none;stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect1547"
width="39.6875"
height="35.71875"
x="-25.390602"
y="312.93103" />
</clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#fcfcfc"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="1"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="10.681815"
inkscape:cy="89.597718"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1172"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:snap-global="false" />
<metadata
id="metadata884">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-261.28123)">
<rect
style="fill:#fcfcfc;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect819"
width="39.6875"
height="35.71875"
x="0"
y="261.28122" />
<image
sodipodi:absref="../images/primehub.png"
xlink:href="../images/primehub.png"
style="stroke-width:5.92592621"
width="34.915073"
height="35.71875"
preserveAspectRatio="none"
id="image1503"
x="2.6458333"
y="261.28122" />
<path
style="fill:none;stroke:#84ba4c;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 31.147057,265.82725 1.011052,2.9815 3.622948,-4.60003"
id="path854"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="150"
height="135"
viewBox="0 0 39.687499 35.718751"
version="1.1"
id="svg887"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="compat_technichub_false.svg">
<defs
id="defs881">
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1545">
<rect
style="fill:#fe2020;fill-opacity:0.48022599;stroke:none;stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect1547"
width="39.6875"
height="35.71875"
x="-25.390602"
y="312.93103" />
</clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#fcfcfc"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="1"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="10.681815"
inkscape:cy="89.597718"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1172"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:snap-global="false" />
<metadata
id="metadata884">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-261.28123)">
<rect
style="fill:#fcfcfc;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect819"
width="39.6875"
height="35.71875"
x="0"
y="261.28122" />
<image
sodipodi:absref="../images/technichub.png"
xlink:href="../images/technichub.png"
style="stroke-width:5.92592621"
width="35.71875"
height="35.71875"
preserveAspectRatio="none"
id="image1514"
x="2.1503351"
y="261.28122" />
<g
id="g862"
transform="matrix(0.84064533,0,0,0.84993509,-12.416361,243.07822)"
style="stroke-width:1.18304348">
<path
inkscape:connector-curvature="0"
id="path856"
d="m 51.33389,24.998882 5.622395,5.622396"
style="fill:none;stroke:#e2302f;stroke-width:1.18304348;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
style="fill:none;stroke:#e2302f;stroke-width:1.18304348;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 56.956285,24.998882 51.33389,30.621278"
id="path858"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="150"
height="135"
viewBox="0 0 39.687499 35.718751"
version="1.1"
id="svg887"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="compat_technichub_true.svg">
<defs
id="defs881">
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1545">
<rect
style="fill:#fe2020;fill-opacity:0.48022599;stroke:none;stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect1547"
width="39.6875"
height="35.71875"
x="-25.390602"
y="312.93103" />
</clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#fcfcfc"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="1"
inkscape:pageshadow="2"
inkscape:zoom="3.959798"
inkscape:cx="51.592993"
inkscape:cy="94.901019"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1853"
inkscape:window-height="1145"
inkscape:window-x="67"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:snap-global="false" />
<metadata
id="metadata884">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-261.28123)">
<rect
style="fill:#fcfcfc;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
id="rect819"
width="39.6875"
height="35.71875"
x="0"
y="261.28122" />
<image
sodipodi:absref="../images/technichub.png"
xlink:href="../images/technichub.png"
y="261.28122"
x="2.1503351"
id="image1514"
preserveAspectRatio="none"
height="35.71875"
width="35.71875"
style="stroke-width:5.92592621" />
<path
style="fill:none;stroke:#84ba4c;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 31.147057,265.82725 1.011052,2.9815 3.622948,-4.60003"
id="path854"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Before

Width:  |  Height:  |  Size: 236 KiB

After

Width:  |  Height:  |  Size: 236 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

+14
View File
@@ -0,0 +1,14 @@
0 Name: hubs.ldr
0 Author: Pybricks {laurens@pybricks.com}
0 !LICENSE MIT
0 ROTATION CENTER 0 0 0 1 "Custom"
0 ROTATION CONFIG 0 0
1 15 -20 -56 320 1 0 0 0 1 0 0 0 1 26910.dat
1 15 -330 -80 110 0 0 1 0 1 0 -1 0 0 28738.dat
1 71 -310 -40 390 1 0 0 0 1 0 0 0 1 22127.dat
1 15 260 -16 90 1 0 0 0 1 0 0 0 1 45601p02.dat
1 3 440 -16 10 1 0 0 0 1 0 0 0 1 45601c01.dat
1 3 780 -16 -310 1 0 0 0 1 0 0 0 1 45601c01.dat
1 15 -930 -40 360 1 0 0 0 1 0 0 0 1 95646c01.dat
1 15 -1490 32 350 1 0 0 0 1 0 0 0 1 53788c01.dat
0
+11
View File
@@ -0,0 +1,11 @@
0 Name: hubsoverview.ldr
0 Author: Pybricks {laurens@pybricks.com}
0 !LICENSE MIT
0 ROTATION CENTER 0 0 0 1 "Custom"
0 ROTATION CONFIG 0 0
1 15 90 -56 300 1 0 0 0 1 0 0 0 1 26910.dat
1 15 -150 -80 300 1 0 0 0 1 0 0 0 1 28738.dat
1 71 -360 -40 120 -1 0 0 0 1 0 0 0 -1 22127.dat
1 15 -160 -16 -40 1 0 0 0 1 0 0 0 1 45601p02.dat
1 3 50 -16 -140 1 0 0 0 1 0 0 0 1 45601c01.dat
0
+40
View File
@@ -0,0 +1,40 @@
0 Name: imu.ldr
0 Author: Pybricks {laurens@pybricks.com}
0 !LICENSE MIT
0 ROTATION CENTER 0 0 0 1 "Custom"
0 ROTATION CONFIG 0 0
1 3 -80 -20 160 0 0 1 0 1 0 -1 0 0 45601c01.dat
1 322 0 20 70 1 0 0 0 1 0 0 0 1 39367p01.dat
1 322 -160 20 70 1 0 0 0 1 0 0 0 1 39367p01.dat
1 322 0 20 250 1 0 0 0 1 0 0 0 1 39367p01.dat
1 322 -160 20 250 1 0 0 0 1 0 0 0 1 39367p01.dat
0 WRITE Type in the comment
1 3 720 -80 170 0 0 -1 0 -1 0 -1 0 0 45601c01.dat
1 322 800 20 80 1 0 0 0 1 0 0 0 1 39367p01.dat
1 322 640 20 80 1 0 0 0 1 0 0 0 1 39367p01.dat
1 322 800 20 260 1 0 0 0 1 0 0 0 1 39367p01.dat
1 322 640 20 260 1 0 0 0 1 0 0 0 1 39367p01.dat
0 WRITE Type in the comment
1 3 720 -70 -630 0 1 0 0 0 -1 -1 0 0 45601c01.dat
1 322 770 20 -720 1 0 0 0 1 0 0 0 1 39367p01.dat
1 322 610 20 -720 1 0 0 0 1 0 0 0 1 39367p01.dat
1 322 770 20 -540 1 0 0 0 1 0 0 0 1 39367p01.dat
1 322 610 20 -540 1 0 0 0 1 0 0 0 1 39367p01.dat
0 WRITE Type in the comment
0 WRITE Type in the comment
0 MLCAD BTG Group name
1 71 -230 60 -780 0 0 1 -1 0 0 0 -1 0 55615.dat
0 MLCAD BTG Group name
1 4 -90 60 -800 0 0 1 -1 0 0 0 -1 0 32278.dat
0 MLCAD BTG Group name
1 2 -250 60 -640 0 1 0 -1 0 0 0 0 1 32278.dat
0 MLCAD BTG Group name
1 71 -230 40 -780 0 0 1 0 1 0 -1 0 0 55615.dat
0 MLCAD BTG Group name
1 1 -250 -100 -780 0 1 0 0 0 -1 -1 0 0 32278.dat
0 GROUP 5 Group name
1 15 -20 90 -570 0 0 -1 0 -1 0 -1 0 0 3811.dat
1 15 720 90 -570 0 0 -1 0 -1 0 -1 0 0 3811.dat
1 15 -30 90 190 0 0 -1 0 -1 0 -1 0 0 3811.dat
1 15 720 90 190 0 0 -1 0 -1 0 -1 0 0 3811.dat
0
Binary file not shown.

After

Width:  |  Height:  |  Size: 654 KiB

Some files were not shown because too many files have changed in this diff Show More