Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import pip
pip.main(['install', 'sphinx_bootstrap_theme'])
pip.main(['install', 'recommonmark'])
pip.main(['install', 'evdev'])

import sphinx_bootstrap_theme
from recommonmark.parser import CommonMarkParser
Expand Down
2 changes: 1 addition & 1 deletion docs/motors.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Motor classes
=============

.. currentmodule:: ev3dev.core
.. currentmodule:: ev3dev.motor

Tacho motor
-----------
Expand Down
46 changes: 9 additions & 37 deletions docs/other.rst
Original file line number Diff line number Diff line change
@@ -1,38 +1,10 @@
Other classes
=============

.. currentmodule:: ev3dev.core

Remote Control
--------------

.. autoclass:: RemoteControl
:members:
:inherited-members:

.. rubric:: Event handlers

These will be called when state of the corresponding button is changed:

.. py:data:: on_red_up
.. py:data:: on_red_down
.. py:data:: on_blue_up
.. py:data:: on_blue_down
.. py:data:: on_beacon

.. rubric:: Member functions and properties

Beacon Seeker
-------------

.. autoclass:: BeaconSeeker
:members:
:inherited-members:

Button
------

.. autoclass:: ev3dev.ev3.Button
.. autoclass:: ev3dev.button.Button
:members:
:inherited-members:

Expand All @@ -52,10 +24,10 @@ Button
Leds
----

.. autoclass:: Led
.. autoclass:: ev3dev.led.Led
:members:

.. autoclass:: ev3dev.ev3.Leds
.. autoclass:: ev3dev.led.Leds
:members:

.. rubric:: EV3 platform
Expand Down Expand Up @@ -87,26 +59,26 @@ Leds
Power Supply
------------

.. autoclass:: PowerSupply
.. autoclass:: ev3dev.power.PowerSupply
:members:

Sound
-----

.. autoclass:: Sound
.. autoclass:: ev3dev.sound.Sound
:members:

Screen
------

.. autoclass:: Screen
.. autoclass:: ev3dev.display.Display
:members:
:show-inheritance:

Bitmap fonts
^^^^^^^^^^^^

The :py:class:`Screen` class allows to write text on the LCD using python
The :py:class:`Display` class allows to write text on the LCD using python
imaging library (PIL) interface (see description of the ``text()`` method
`here <http://pillow.readthedocs.io/en/3.1.x/reference/ImageDraw.html#PIL.ImageDraw.PIL.ImageDraw.Draw.text>`_).
The ``ev3dev.fonts`` module contains bitmap fonts in PIL format that should
Expand All @@ -115,7 +87,7 @@ look good on a tiny EV3 screen:
.. code-block:: py

import ev3dev.fonts as fonts
screen.draw.text((10,10), 'Hello World!', font=fonts.load('luBS14'))
display.draw.text((10,10), 'Hello World!', font=fonts.load('luBS14'))

.. autofunction:: ev3dev.fonts.available

Expand All @@ -129,5 +101,5 @@ to EV3 screen size:
Lego Port
---------

.. autoclass:: LegoPort
.. autoclass:: ev3dev.port.LegoPort
:members:
18 changes: 8 additions & 10 deletions docs/sensors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ Sensor

This is the base class all the other sensor classes are derived from.

.. currentmodule:: ev3dev.core

.. autoclass:: Sensor
.. autoclass:: ev3dev.sensor.Sensor
:members:

Special sensor classes
Expand All @@ -23,7 +21,7 @@ sure the sensor is in the required mode and then returns the specified value.
Touch Sensor
########################

.. autoclass:: TouchSensor
.. autoclass:: ev3dev.sensor.lego.TouchSensor
:members:
:show-inheritance:

Expand All @@ -32,7 +30,7 @@ Touch Sensor
Color Sensor
########################

.. autoclass:: ColorSensor
.. autoclass:: ev3dev.sensor.lego.ColorSensor
:members:
:show-inheritance:

Expand All @@ -41,7 +39,7 @@ Color Sensor
Ultrasonic Sensor
########################

.. autoclass:: UltrasonicSensor
.. autoclass:: ev3dev.sensor.lego.UltrasonicSensor
:members:
:show-inheritance:

Expand All @@ -50,7 +48,7 @@ Ultrasonic Sensor
Gyro Sensor
########################

.. autoclass:: GyroSensor
.. autoclass:: ev3dev.sensor.lego.GyroSensor
:members:
:show-inheritance:

Expand All @@ -59,7 +57,7 @@ Gyro Sensor
Infrared Sensor
########################

.. autoclass:: InfraredSensor
.. autoclass:: ev3dev.sensor.lego.InfraredSensor
:members:
:show-inheritance:

Expand All @@ -68,7 +66,7 @@ Infrared Sensor
Sound Sensor
########################

.. autoclass:: SoundSensor
.. autoclass:: ev3dev.sensor.lego.SoundSensor
:members:
:show-inheritance:

Expand All @@ -77,7 +75,7 @@ Sound Sensor
Light Sensor
########################

.. autoclass:: LightSensor
.. autoclass:: ev3dev.sensor.lego.LightSensor
:members:
:show-inheritance:

Expand Down
10 changes: 5 additions & 5 deletions docs/spec.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ API reference

Each class in ev3dev module inherits from the base :py:class:`Device` class.

.. autoclass:: ev3dev.core.Device
.. autoclass:: ev3dev.Device

.. autofunction:: ev3dev.core.list_device_names
.. autofunction:: ev3dev.list_device_names

.. autofunction:: ev3dev.core.list_devices
.. autofunction:: ev3dev.list_devices

.. autofunction:: ev3dev.core.list_motors
.. autofunction:: ev3dev.motor.list_motors

.. autofunction:: ev3dev.core.list_sensors
.. autofunction:: ev3dev.sensor.list_sensors

.. rubric:: Contents:

Expand Down
4 changes: 2 additions & 2 deletions ev3dev/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def text_pixels(self, text, clear_screen=True, x=0, y=0, text_color='black', fon
'text_color' : PIL says it supports "common HTML color names". There
are 140 HTML color names listed here that are supported by all modern
browsers. This is probably a good list to start with.
https://www.w3schools.com/colors/colors_names.asp
https://www.w3schools.com/colors/colors_names.asp

'font' : can be any font displayed here
http://ev3dev-lang.readthedocs.io/projects/python-ev3dev/en/stable/other.html#bitmap-fonts
Expand All @@ -373,7 +373,7 @@ def text_grid(self, text, clear_screen=True, x=0, y=0, text_color='black', font=
'text_color' : PIL says it supports "common HTML color names". There
are 140 HTML color names listed here that are supported by all modern
browsers. This is probably a good list to start with.
https://www.w3schools.com/colors/colors_names.asp
https://www.w3schools.com/colors/colors_names.asp

'font' : can be any font displayed here
http://ev3dev-lang.readthedocs.io/projects/python-ev3dev/en/stable/other.html#bitmap-fonts
Expand Down
1 change: 1 addition & 0 deletions ev3dev/port.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# -----------------------------------------------------------------------------

import sys
from . import Device

if sys.version_info < (3,4):
raise SystemError('Must be using Python 3.4 or higher')
Expand Down
2 changes: 1 addition & 1 deletion ev3dev/sensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def list_sensors(name_pattern=Sensor.SYSTEM_DEVICE_NAME_CONVENTION, **kwargs):
keyword arguments: used for matching the corresponding device
attributes. For example, driver_name='lego-ev3-touch', or
address=['in1', 'in3']. When argument value is a list,
then a match against any entry of the list is enough.
then a match against any entry of the list is enough.
"""
class_path = abspath(Device.DEVICE_ROOT_PATH + '/' + Sensor.SYSTEM_CLASS_NAME)
return (Sensor(name_pattern=name, name_exact=True)
Expand Down
2 changes: 1 addition & 1 deletion ev3dev/sound.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def play_note(self, note, duration, volume=100, play_type=PLAY_WAIT_FOR_COMPLETE
duration (float): tone duration, in seconds
volume (int) the play volume, in percent of maximum volume
play_type (int) the type of play (wait, no wait, loop), as defined
by the ``PLAY_xxx`` constants
by the ``PLAY_xxx`` constants

Returns:
the PID of the underlying beep command if no wait play type, None otherwise
Expand Down