@@ -14,17 +14,19 @@ A Python3 library implementing an interface for ev3dev_ devices,
1414letting you control motors, sensors, hardware buttons, LCD
1515displays and more from Python code.
1616
17- If you haven't written code in Python before, you'll need to learn the language
18- before you can use this library.
17+ If you haven't written code in Python before, you can certainly use this
18+ library to help you learn the language!
1919
2020Getting Started
2121---------------
2222
2323This library runs on ev3dev _. Before continuing, make sure that you have set up
24- your EV3 or other ev3dev device as explained in the `ev3dev Getting Started guide `_.
25- Make sure you have an ev3dev-stretch version greater than ``2.2.0 ``. You can check
26- the kernel version by selecting "About" in Brickman and scrolling down to the
27- "kernel version". If you don't have a compatible version, `upgrade the kernel before continuing `_.
24+ your EV3 or other ev3dev device as explained in the
25+ `ev3dev Getting Started guide `_. Make sure you have an ev3dev-stretch version
26+ greater than ``2.2.0 ``. You can check the kernel version by selecting
27+ "About" in Brickman and scrolling down to the "kernel version".
28+ If you don't have a compatible version,
29+ `upgrade the kernel before continuing `_.
2830
2931Usage
3032-----
@@ -36,8 +38,8 @@ once you have that set up.
3638
3739Otherwise, you can can work with files `via an SSH connection `_ with an editor
3840such as `nano `_, use the Python interactive REPL (type ``python3 ``), or roll
39- your own solution. If you don't know how to do that, you are probably better off
40- choosing the recommended option above.
41+ your own solution. If you don't know how to do that, you are probably
42+ better off choosing the recommended option above.
4143
4244The template for a Python script
4345~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -64,16 +66,19 @@ or additional utilities.
6466
6567You should use the ``.py `` extension for your file, e.g. ``my-file.py ``.
6668
67- If you encounter an error such as ``/usr/bin/env: 'python3\r': No such file or directory ``,
68- you must switch your editor's "line endings" setting for the file from "CRLF" to just "LF".
69- This is usually in the status bar at the bottom. For help, see `our FAQ page `_.
69+ If you encounter an error such as
70+ ``/usr/bin/env: 'python3\r': No such file or directory ``,
71+ you must switch your editor's "line endings" setting for the file from
72+ "CRLF" to just "LF". This is usually in the status bar at the bottom.
73+ For help, see `our FAQ page `_.
7074
7175Important: Make your script executable (non-Visual Studio Code only)
7276~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7377
7478To be able to run your Python file, **your program must be executable **. If
75- you are using the `ev3dev Visual Studio Code extension `_, you can skip this step,
76- as it will be automatically performed when you download your code to the brick.
79+ you are using the `ev3dev Visual Studio Code extension `_, you can skip this
80+ step, as it will be automatically performed when you download your code to the
81+ brick.
7782
7883**To mark a program as executable from the command line (often an SSH session),
7984run ** ``chmod +x my-file.py ``.
@@ -85,8 +90,8 @@ Controlling the LEDs with a touch sensor
8590~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8691
8792This code will turn the LEDs red whenever the touch sensor is pressed, and
88- back to green when it's released. Plug a touch sensor into any sensor port before
89- trying this out.
93+ back to green when it's released. Plug a touch sensor into any sensor port
94+ before trying this out.
9095
9196.. code-block :: python
9297
@@ -120,8 +125,8 @@ This will run a LEGO Large Motor at 75% of maximum speed for 5 rotations.
120125 m.on_for_rotations(SpeedPercent(75 ), 5 )
121126
122127 You can also run a motor for a number of degrees, an amount of time, or simply
123- start it and let it run until you tell it to stop. Additionally, other units are
124- also available. See the following pages for more information:
128+ start it and let it run until you tell it to stop. Additionally, other units
129+ are also available. See the following pages for more information:
125130
126131- http://python-ev3dev.readthedocs.io/en/ev3dev-stretch/motors.html#ev3dev.motor.Motor.on_for_degrees
127132- http://python-ev3dev.readthedocs.io/en/ev3dev-stretch/motors.html#units
@@ -138,12 +143,12 @@ The simplest drive control style is with the `MoveTank` class:
138143 # drive in a turn for 5 rotations of the outer motor
139144 # the first two parameters can be unit classes or percentages.
140145 tank_drive.on_for_rotations(SpeedPercent(50 ), SpeedPercent(75 ), 10 )
141-
146+
142147 # drive in a different turn for 3 seconds
143148 tank_drive.on_for_seconds(SpeedPercent(60 ), SpeedPercent(30 ), 3 )
144149
145- There are also `MoveSteering ` and `MoveJoystick ` classes which provide different
146- styles of control. See the following pages for more information:
150+ There are also `MoveSteering ` and `MoveJoystick ` classes which provide
151+ different styles of control. See the following pages for more information:
147152
148153- http://python-ev3dev.readthedocs.io/en/ev3dev-stretch/motors.html#multiple-motor-groups
149154- http://python-ev3dev.readthedocs.io/en/ev3dev-stretch/motors.html#units
@@ -160,74 +165,43 @@ If you want to make your robot speak, you can use the ``Sound.speak`` method:
160165 sound = Sound()
161166 sound.speak(' Welcome to the E V 3 dev project!' )
162167
163- Make sure to check out the `User Resources `_ section for more detailed
164- information on these features and many others.
168+ More Demo Code
169+ ~~~~~~~~~~~~~~
170+
171+ There are several demo programs that you can run to get acquainted with
172+ this language binding. The programs are available
173+ `at this GitHub site <https://github.com/ev3dev/ev3dev-lang-python-demo >`_.
174+
175+ You can also copy and run the programs in the `utils ` directory to
176+ understand some of the code constructs to use the EV3 motors, sensors,
177+ LCD console, buttons, sound, and LEDs.
178+
179+ We also highly recommend `ev3python.com `_ where one of our community
180+ members, @ndward, has put together a great website with detailed guides
181+ on using this library which are targeted at beginners. If you are just
182+ getting started with programming, we highly recommend that you check
183+ it out at `ev3python.com `_!
165184
166185Using Micropython
167186-----------------
168187
169- Normal Python too slow? Try `Micropython `_ if it supports the features your
170- project needs.
171-
172- User Resources
173- --------------
188+ Normal Python too slow? Review `Micropython `_ to see if it supports the
189+ features your project needs.
174190
175191Library Documentation
176- **Class documentation for this library can be found on ** `our Read the Docs page `_ **. **
177- You can always go there to get information on how you can use this
178- library's functionality.
192+ ---------------------
179193
180- Demo Code
181- There are several demo programs that you can run to get acquainted with
182- this language binding. The programs are available at
183- https://github.com/ev3dev/ev3dev-lang-python-demo
194+ **Class documentation for this library can be found on
195+ ** `our Read the Docs page`_ **. ** You can always go there to get
196+ information on how you can use this library's functionality.
184197
185- ev3python.com
186- One of our community members, @ndward, has put together a great website
187- with detailed guides on using this library which are targeted at beginners.
188- If you are just getting started with programming, we highly recommend
189- that you check it out at `ev3python.com `_!
190198
191199Frequently-Asked Questions
192- Experiencing an odd error or unsure of how to do something that seems
193- simple? Check our our `FAQ `_ to see if there's an existing answer.
194-
195- ev3dev.org
196- `ev3dev.org `_ is a great resource for finding guides and tutorials on
197- using ev3dev, straight from the maintainers.
198-
199- Support
200- If you are having trouble using this library, please open an issue
201- at `our Issues tracker `_ so that we can help you. When opening an
202- issue, make sure to include as much information as possible about
203- what you are trying to do and what you have tried. The issue template
204- is in place to guide you through this process.
205-
206- Upgrading this Library
207- ----------------------
208-
209- You can upgrade this library from the command line as follows. Make sure
210- to type the password (the default is ``maker ``) when prompted.
211-
212- .. code-block :: bash
213-
214- sudo apt-get update
215- sudo apt-get install --only-upgrade python3-ev3dev2
216-
217-
218- Developer Resources
219- -------------------
220-
221- Python Package Index
222- The Python language has a `package repository `_ where you can find
223- libraries that others have written, including the `latest version of
224- this package `_.
200+ --------------------------
225201
226- Python 2.x and Python 3.x Compatibility
227- ---------------------------------------
202+ Experiencing an odd error or unsure of how to do something that seems
203+ simple? Check our our ` FAQ `_ to see if there's an existing answer.
228204
229- Some versions of the ev3dev _ distribution come with both `Python 2.x `_ and `Python 3.x `_ installed
230- but this library is compatible only with Python 3.
231205
232206.. _ev3dev : http://ev3dev.org
233207.. _ev3dev.org : ev3dev _
0 commit comments