Skip to content

Commit d593831

Browse files
committed
doc: add figure numbers and reference labels
fixes #131
1 parent de20127 commit d593831

File tree

6 files changed

+67
-30
lines changed

6 files changed

+67
-30
lines changed

doc/source/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@
9595
# If true, `todo` and `todoList` produce output, else they produce nothing.
9696
todo_include_todos = True
9797

98+
# Figure numbering
99+
numfig = True
100+
98101
# -- Autodoc options ------------------------------------------------------
99102

100103
autodoc_member_order = 'bysource'

doc/source/examples/color_sorter.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
Color Sorter
22
=====================
33

4-
This example program for the color sorter lets you scan colored Technic beams using the Color Sensor.
4+
This example program for the color sorter (:numref:`fig_color_sorter`) lets you scan colored Technic beams using the Color Sensor.
55

66
Scan the colored beams one by one and add them to the tray. A beep confirms that it has registered the color. When the tray is full or when you press the center button, the robot will start distributing the Technic bricks by color.
77

88
You can find building instructions for the color sorter on the `LEGO Education website <https://le-www-live-s.legocdn.com/sc/media/lessons/mindstorms-ev3/building-instructions/ev3-model-core-set-color-sorter-c778563f88c986841453574495cb5ff1.pdf>`_.
99

10+
.. _fig_color_sorter:
1011

1112
.. figure:: ../images/color_sorter.jpg
1213
:width: 90 %
13-
:alt: overview
14+
:alt: color_sorter
1415
:align: center
1516

1617
Color Sorter

doc/source/examples/robot_arm_h25.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
Robot Arm H25
22
=====================
33

4-
This example program makes the robot move the black wheel hub stacks around forever. The robot arm will first initialize and then start moving the hubs around.
4+
This example program makes the robot (:numref:`fig_robot_arm`) move the black wheel hub stacks around forever. The robot arm will first initialize and then start moving the hubs around.
55

66
You can find building instructions for the robot on the `LEGO Education website <https://le-www-live-s.legocdn.com/sc/media/lessons/mindstorms-ev3/building-instructions/ev3-model-core-set-robot-arm-h25-56cdb22c1e3a02f1770bda72862ce2bd.pdf>`_.
77

88
Tip: When building the robot, reverse the orientation of the EV3 Brick such that the microSD card is easily accessible.
99

10+
.. _fig_robot_arm:
11+
1012
.. figure:: ../images/robot_arm.jpg
1113
:width: 90 %
12-
:alt: overview
14+
:alt: robot_arm
1315
:align: center
1416

1517
Robot Arm H25

doc/source/examples/robot_educator.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
Robot Educator
22
=====================
33

4-
This example makes the Robot Educator drive until it sees an obstacle. It then backs up, turns around, and starts driving again.
4+
This example makes the Robot Educator (:numref:`fig_robot_educator`) drive until it sees an obstacle. It then backs up, turns around, and starts driving again.
55

66
You can find building instructions for the Robot Educator on the `LEGO Education website <https://education.lego.com/en-us/support/mindstorms-ev3/building-instructions#robot>`_.
77

8+
.. _fig_robot_educator:
9+
810
.. figure:: ../images/ultrasonic_sensor_driving_base.jpg
911
:width: 50 %
10-
:alt: overview
12+
:alt: robot_educator
1113
:align: center
1214

1315
Robot Educator with the Ultrasonic Sensor

doc/source/startinstall.rst

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ To get started, you'll need:
2323

2424
- A mini-USB cable, like the one included with your EV3 set
2525

26-
The typical configuration of this equipment is summarized in the figure below.
26+
The typical configuration of this equipment is summarized in :numref:`fig_overview`.
27+
28+
.. _fig_overview:
2729

2830
.. figure:: images/overview.png
2931
:width: 90 %
3032
:alt: overview
31-
:align: center
33+
:align: center
34+
35+
Setup overview
3236

3337
Preparing your computer
3438
-----------------------------------------------------------
@@ -38,8 +42,10 @@ You'll write your MicroPython programs using Visual Studio Code. Follow the step
3842
1. Download `Visual Studio Code <https://code.visualstudio.com/Download>`_.
3943
2. Follow the on-screen instructions to install the application.
4044
3. Launch Visual Studio Code.
41-
4. Open the extensions tab as shown below.
42-
5. Install and activate the required extension:
45+
4. Open the extensions tab.
46+
5. Install the extension as shown in :numref:`fig_store`.
47+
48+
.. _fig_store:
4349

4450
.. figure:: images/store.png
4551
:alt: store
@@ -65,12 +71,14 @@ To install the MicroPython tools on your microSD card:
6571
1. Download the `EV3 MicroPython microSD card image <.>`_ and save it in a convenient location. This file is approximately 360 MB. Do **not** open or unzip the file.
6672
2. Download and install a microSD card flashing tool such as `Etcher <https://www.balena.io/etcher/>`_.
6773
3. Insert the microSD card into your computer or card reader.
68-
4. Launch the flashing tool and follow the steps on your screen to install the file you have just downloaded. If you use Etcher, you can follow the instructions in the diagram below:
74+
4. Launch the flashing tool and follow the steps on your screen to install the file you have just downloaded. If you use Etcher, you can follow the instructions below, as shown in :numref:`fig_etcher`.
6975

7076
a. Select the EV3 MicroPython microSD card image file you have just downloaded.
7177
b. Select your microSD card. Make sure that the device and size correspond to your microSD card.
7278
c. Start the flashing process. This may take several minutes. Do not remove the card until the flashing process is complete.
7379

80+
.. _fig_etcher:
81+
7482
.. figure:: images/etcher.png
7583
:width: 85 %
7684
:alt: etcher
@@ -88,7 +96,9 @@ You do not need to erase the contents of the microSD card first. This is done au
8896
Using the EV3 Brick
8997
-----------------------------------------------------------
9098

91-
Make sure the EV3 Brick is turned off. Insert the microSD card you prepared into the microSD card slot on the EV3 Brick, as shown below.
99+
Make sure the EV3 Brick is turned off. Insert the microSD card you prepared into the microSD card slot on the EV3 Brick, as shown in :numref:`fig_sd`.
100+
101+
.. _fig_sd:
92102

93103
.. figure:: images/sd.png
94104
:width: 75 %
@@ -105,7 +115,9 @@ Turn on the EV3 Brick by pressing the dark gray center button.
105115

106116
The boot process may take several minutes. While booting, the EV3 Brick status light turns orange and blinks intermittently, and you'll see a lot of text on the EV3 screen. The EV3 Brick is ready for use when the status light turns green.
107117

108-
To turn the EV3 Brick off, open the shutdown menu with the back button, and then select *Power Off* using the center button, as shown below.
118+
To turn the EV3 Brick off, open the shutdown menu with the back button, and then select *Power Off* using the center button, as shown in :numref:`fig_onoff`.
119+
120+
.. _fig_onoff:
109121

110122
.. figure:: images/onoff.png
111123
:width: 65 %
@@ -117,7 +129,9 @@ To turn the EV3 Brick off, open the shutdown menu with the back button, and then
117129
Viewing motor and sensor values
118130
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
119131

120-
When you're not running a program, you can view motor and sensor values using the device browser, as shown below.
132+
When you're not running a program, you can view motor and sensor values using the device browser, as shown in :numref:`fig_devicebrowser`.
133+
134+
.. _fig_devicebrowser:
121135

122136
.. figure:: images/devicebrowser.png
123137
:width: 100 %

doc/source/startrun.rst

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ Now that you've set up your computer and EV3 Brick, you're ready to start writin
55

66
To make it easier to create and manage your programs, let's first have a quick look at how MicroPython projects and programs for your EV3 robots are organized.
77

8-
Programs are organized into *project folders*, as shown below. A project folder is a directory on your computer that contains the main program (**main.py**) and other optional scripts or files. This project folder and all of its contents will be copied to the EV3 Brick, where the main program will be run.
8+
Programs are organized into *project folders*, as shown in :numref:`fig_projectstructure`. A project folder is a directory on your computer that contains the main program (**main.py**) and other optional scripts or files. This project folder and all of its contents will be copied to the EV3 Brick, where the main program will be run.
99

1010
This page shows you how to create such a project and how to transfer it to the EV3 Brick.
1111

1212

13+
.. _fig_projectstructure:
14+
1315
.. figure:: images/projectstructure.png
1416
:width: 100 %
15-
:alt: alt
17+
:alt: projectstructure
1618
:align: center
1719

1820
A project contains a program called **main.py** and optional resources like sounds or MicroPython modules.
@@ -21,22 +23,26 @@ This page shows you how to create such a project and how to transfer it to the E
2123
Creating a new project
2224
-----------------------------------------------------------
2325

24-
To create a new project, open the Pybricks tab and click *create a new project*, as shown below. Enter a project name in the text field that appears and press *Enter*. When prompted, choose a location for this program and confirm by clicking *choose folder*.
26+
To create a new project, open the Pybricks tab and click *create a new project*, as shown in :numref:`fig_newproject`. Enter a project name in the text field that appears and press *Enter*. When prompted, choose a location for this program and confirm by clicking *choose folder*.
27+
28+
.. _fig_newproject:
2529

2630
.. figure:: images/newproject.png
2731
:width: 100 %
28-
:alt: alt
32+
:alt: newproject
2933
:align: center
3034

3135
Creating a new project. This example is called *getting_started*, but you can choose any name.
3236

33-
When you create a new project, it already includes a file called *main.py*. To see its contents and to modify it, open it from the file browser as shown below. This is where you'll write your programs.
37+
When you create a new project, it already includes a file called *main.py*. To see its contents and to modify it, open it from the file browser as shown in :numref:`fig_projectoverview`. This is where you'll write your programs.
3438

3539
If you are new to MicroPython programming, we recommend that you keep the existing code in place and add your code to it.
3640

41+
.. _fig_projectoverview:
42+
3743
.. figure:: images/projectoverview.png
3844
:width: 100 %
39-
:alt: alt
45+
:alt: projectoverview
4046
:align: center
4147

4248
Opening the default *main.py* program.
@@ -50,40 +56,45 @@ To be able to transfer your code to the EV3 Brick, you'll first need to connect
5056

5157
- Turn the EV3 Brick on
5258
- Connect the EV3 Brick to your computer with the mini-USB cable
53-
- Configure the USB connection as shown:
59+
- Configure the USB connection as shown in :numref:`fig_connecting`.
60+
61+
.. _fig_connecting:
5462

5563
.. figure:: images/connecting.png
5664
:width: 100 %
57-
:alt: alt
65+
:alt: connecting
5866
:align: center
5967

6068
Configuring the USB connection between the computer and the EV3 Brick
6169

6270
Downloading and running a program
6371
-----------------------------------------------------------
6472

65-
You can press the F5 key to run the program. Alternatively, you can start it manually by going to the *debug* tab and clicking the green start arrow, as shown below.
73+
You can press the F5 key to run the program. Alternatively, you can start it manually by going to the *debug* tab and clicking the green start arrow, as shown in :numref:`fig_running`.
6674

6775
When the program starts, a pop-up toolbar allows you to stop the program if necessary. You can also stop the program at any time using the back button on the EV3 Brick.
6876

6977
If your program produces any output with the :mod:`print <.tools>` command, this is shown in the output window.
7078

79+
.. _fig_running:
80+
7181
.. figure:: images/running.png
7282
:width: 100 %
73-
:alt: alt
83+
:alt: running
7484
:align: center
7585

7686
Running a program
7787

7888
Expanding the example program
7989
-----------------------------------------------------------
8090

81-
Now that you've run the basic code template, you can expand the program to make a motor move. First, attach a Large Motor to Port B on the EV3 Brick, as shown below.
91+
Now that you've run the basic code template, you can expand the program to make a motor move. First, attach a Large Motor to Port B on the EV3 Brick, as shown in :numref:`fig_firstprogram`.
8292

93+
.. _fig_firstprogram:
8394

8495
.. figure:: images/firstprogram.png
8596
:width: 100 %
86-
:alt: alt
97+
:alt: firstprogram
8798
:align: center
8899

89100
The EV3 Brick with a Large Motor attached to port B.
@@ -99,11 +110,13 @@ This program makes your robot beep, rotate the motor, and beep again with a high
99110
Managing files on the EV3 Brick
100111
-----------------------------------------------------------
101112

102-
After you've downloaded a project to the EV3 Brick, you can run, delete, or back up programs stored on it using the device browser:
113+
After you've downloaded a project to the EV3 Brick, you can run, delete, or back up programs stored on it using the device browser as shown in in :numref:`fig_files`.
114+
115+
.. _fig_files:
103116

104117
.. figure:: images/files.png
105118
:width: 100 %
106-
:alt: alt
119+
:alt: files
107120
:align: center
108121

109122
Using the device browser to manage files on your EV3 Brick
@@ -114,11 +127,13 @@ Running a program without a computer
114127

115128
You can run previously downloaded programs directly from the EV3 Brick.
116129

117-
To do so, find the program using the *file browser* on the EV3 screen and press the center button key to start the program.
130+
To do so, find the program using the *file browser* on the EV3 screen and press the center button key to start the program as shown in in :numref:`fig_manualrun`.
131+
132+
.. _fig_manualrun:
118133

119134
.. figure:: images/manualrun.png
120135
:width: 100 %
121-
:alt: alt
136+
:alt: manualrun
122137
:align: center
123138

124139
Starting a program using the buttons on the EV3 Brick

0 commit comments

Comments
 (0)