pybricks.iodevices: Document pinout.

This commit is contained in:
Laurens Valk
2026-05-29 15:34:58 +02:00
parent 1b69e42b6b
commit a0e98ba75f
6 changed files with 53 additions and 8 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
.. pybricks-requirements:: pybricks-iodevices ev3
EV3 Analog Sensor
Analog Sensor
^^^^^^^^^^^^^^^^^
.. figure:: ../../main/cad/output/iodevice-rj12brown.png
+1 -1
View File
@@ -1,4 +1,4 @@
EV3 DC Motor
DC Motor
^^^^^^^^^^^^^^^^^^
.. note::
+3
View File
@@ -1,6 +1,9 @@
Generic I2C Device
^^^^^^^^^^^^^^^^^^
EV3 and NXT support connecting generic I2C devices to the hub.
See :doc:`pinout here <uartdevice>`.
.. figure:: ../../main/cad/output/iodevice-rj12cyan.png
:width: 25 %
Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

+36 -4
View File
@@ -3,13 +3,45 @@
Generic UART Device
^^^^^^^^^^^^^^^^^^^
.. |uart-wired| image:: ../../main/cad/output/iodevice-rj12grey.png
:width: 20 %
Powered Up and EV3 support connecting generic UART devices to the hub. The pinout
is shown below. Note the orientation of the connector. For EV3, the internal
wire colors match those on the diagram below.
.. |uart-wireless| image:: ../../main/cad/output/iodevice-pupdevice.png
.. image:: pinout_numbered.jpg
:width: 50 %
|uart-wired| |uart-wireless|
.. list-table::
:header-rows: 1
* - Pin
- Powered Up (UART)
- EV3 (UART sensor)
- EV3 (I2C sensor)
* - 1 (white)
- Motor Terminal 1
- Optional battery power
- Optional battery power
* - 2 (black)
- Motor Terminal 2
- N/A
- N/A
* - 3 (red)
- Ground
- Ground
- Ground
* - 4 (green)
- VCC (3.3 V)
- VCC (5 V)
- VCC (5 V)
* - 5 (yellow)
- Hub TX (Sensor RX) (3.3 V)
- Hub TX (Sensor RX) (3.3 V)
- SCL (master) (3.3 V)
* - 6 (blue)
- Hub RX (Sensor TX) (3.3 V)
- Hub RX (Sensor TX) (3.3 V)
- SDA (master) (3.3 V)
.. autoclass:: pybricks.iodevices.UARTDevice
+12 -2
View File
@@ -181,7 +181,12 @@ class AnalogSensor:
class I2CDevice:
"""Generic or custom I2C device."""
"""Generic or custom I2C device.
Note: Use the ``power_pin`` option at your own risk. Applying power to the
pins can damage your hub or device if you are not careful. When you use
this option, you will be prompted to confirm that you understand the risks.
"""
def __init__(
self,
@@ -259,7 +264,12 @@ class I2CDevice:
class UARTDevice:
"""Generic UART device."""
"""Generic UART device.
Note: Use the ``power_pin`` option at your own risk. Applying power to the
pins can damage your hub or device if you are not careful. When you use
this option, you will be prompted to confirm that you understand the risks.
"""
def __init__(
self,