mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-07-27 19:57:02 +00:00
pybricks.iodevices: Document pinout.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
.. pybricks-requirements:: pybricks-iodevices ev3
|
||||
|
||||
EV3 Analog Sensor
|
||||
Analog Sensor
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. figure:: ../../main/cad/output/iodevice-rj12brown.png
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
EV3 DC Motor
|
||||
DC Motor
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -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 |
@@ -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
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user