Source code for hub.ports

"""The hub's ports — the sockets where you plug in LEGO motors and sensors.

Use ``hub.ports.A`` to ``hub.ports.F``. Each one is a
:class:`lpf2.local.port`, so you can ask it what's plugged in, drive a
motor or read a sensor.
"""

from lpf2 import port as _port
from lpf2.local import port as _local_port

[docs] A: _local_port
"""Port A."""
[docs] B: _local_port
"""Port B."""
[docs] C: _local_port
"""Port C."""
[docs] D: _local_port
"""Port D."""
[docs] E: _local_port
"""Port E."""
[docs] F: _local_port
"""Port F."""
[docs] LED: _port
"""Advanced: the built-in light, as if it were plugged into a port. Usually use ``hub.led`` instead."""
[docs] accelerometer: _port
"""Advanced: the built-in accelerometer, as if it were plugged into a port. Usually use ``hub.accelerometer`` instead."""
[docs] gyro: _port
"""Advanced: the built-in gyroscope, as if it were plugged into a port. Usually use ``hub.gyro`` instead."""