You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/examples/color_sorter.rst
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,17 @@
1
1
Color Sorter
2
2
=====================
3
3
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.
5
5
6
6
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.
7
7
8
8
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>`_.
Copy file name to clipboardExpand all lines: doc/source/examples/robot_arm_h25.rst
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,17 @@
1
1
Robot Arm H25
2
2
=====================
3
3
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.
5
5
6
6
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>`_.
7
7
8
8
Tip: When building the robot, reverse the orientation of the EV3 Brick such that the microSD card is easily accessible.
Copy file name to clipboardExpand all lines: doc/source/examples/robot_educator.rst
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,15 @@
1
1
Robot Educator
2
2
=====================
3
3
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.
5
5
6
6
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>`_.
@@ -38,8 +42,10 @@ You'll write your MicroPython programs using Visual Studio Code. Follow the step
38
42
1. Download `Visual Studio Code <https://code.visualstudio.com/Download>`_.
39
43
2. Follow the on-screen instructions to install the application.
40
44
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:
43
49
44
50
.. figure:: images/store.png
45
51
:alt:store
@@ -65,12 +71,14 @@ To install the MicroPython tools on your microSD card:
65
71
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.
66
72
2. Download and install a microSD card flashing tool such as `Etcher <https://www.balena.io/etcher/>`_.
67
73
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`.
69
75
70
76
a. Select the EV3 MicroPython microSD card image file you have just downloaded.
71
77
b. Select your microSD card. Make sure that the device and size correspond to your microSD card.
72
78
c. Start the flashing process. This may take several minutes. Do not remove the card until the flashing process is complete.
73
79
80
+
.. _fig_etcher:
81
+
74
82
.. figure:: images/etcher.png
75
83
:width:85 %
76
84
:alt:etcher
@@ -88,7 +96,9 @@ You do not need to erase the contents of the microSD card first. This is done au
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:
92
102
93
103
.. figure:: images/sd.png
94
104
:width:75 %
@@ -105,7 +115,9 @@ Turn on the EV3 Brick by pressing the dark gray center button.
105
115
106
116
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.
107
117
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:
109
121
110
122
.. figure:: images/onoff.png
111
123
:width:65 %
@@ -117,7 +129,9 @@ To turn the EV3 Brick off, open the shutdown menu with the back button, and then
Copy file name to clipboardExpand all lines: doc/source/startrun.rst
+31-16Lines changed: 31 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,16 @@ Now that you've set up your computer and EV3 Brick, you're ready to start writin
5
5
6
6
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.
7
7
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.
9
9
10
10
This page shows you how to create such a project and how to transfer it to the EV3 Brick.
11
11
12
12
13
+
.. _fig_projectstructure:
14
+
13
15
.. figure:: images/projectstructure.png
14
16
:width:100 %
15
-
:alt:alt
17
+
:alt:projectstructure
16
18
:align:center
17
19
18
20
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
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:
25
29
26
30
.. figure:: images/newproject.png
27
31
:width:100 %
28
-
:alt:alt
32
+
:alt:newproject
29
33
:align:center
30
34
31
35
Creating a new project. This example is called *getting_started*, but you can choose any name.
32
36
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.
34
38
35
39
If you are new to MicroPython programming, we recommend that you keep the existing code in place and add your code to it.
36
40
41
+
.. _fig_projectoverview:
42
+
37
43
.. figure:: images/projectoverview.png
38
44
:width:100 %
39
-
:alt:alt
45
+
:alt:projectoverview
40
46
:align:center
41
47
42
48
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
50
56
51
57
- Turn the EV3 Brick on
52
58
- 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:
54
62
55
63
.. figure:: images/connecting.png
56
64
:width:100 %
57
-
:alt:alt
65
+
:alt:connecting
58
66
:align:center
59
67
60
68
Configuring the USB connection between the computer and the EV3 Brick
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`.
66
74
67
75
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.
68
76
69
77
If your program produces any output with the :mod:`print <.tools>` command, this is shown in the output window.
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`.
82
92
93
+
.. _fig_firstprogram:
83
94
84
95
.. figure:: images/firstprogram.png
85
96
:width:100 %
86
-
:alt:alt
97
+
:alt:firstprogram
87
98
:align:center
88
99
89
100
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
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:
103
116
104
117
.. figure:: images/files.png
105
118
:width:100 %
106
-
:alt:alt
119
+
:alt:files
107
120
:align:center
108
121
109
122
Using the device browser to manage files on your EV3 Brick
@@ -114,11 +127,13 @@ Running a program without a computer
114
127
115
128
You can run previously downloaded programs directly from the EV3 Brick.
116
129
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:
118
133
119
134
.. figure:: images/manualrun.png
120
135
:width:100 %
121
-
:alt:alt
136
+
:alt:manualrun
122
137
:align:center
123
138
124
139
Starting a program using the buttons on the EV3 Brick
0 commit comments