Skip to content

Commit ce8e0cd

Browse files
author
Martin O'Hanlon
committed
docs update
1 parent 786b984 commit ce8e0cd

File tree

8 files changed

+51
-21
lines changed

8 files changed

+51
-21
lines changed

docs/developing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ Install sphinx using ::
4040

4141
To test the documentation build, run the following command from the docs directory ::
4242

43-
$ make html
43+
$ ./make html
4444

4545
The website will be built in the directory docs/_build/html.
4646

47-
Documentation can be viewed at `picozero.readthedocs.io`_ and is automatically built and deployed on commit.
47+
Documentation can be viewed at `picozero.readthedocs.io`_ and is automatically built and deployed on push to github.
4848

4949
.. _picozero.readthedocs.io: https://picozero.readthedocs.io
5050

docs/examples/led_blink.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from picozero import LED
2-
from time import sleep
32

43
led = LED(14)
54

docs/examples/led_pulse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from time import sleep
21
from picozero import LED
2+
from time import sleep
33
from math import sin, radians
44

55
led = LED(14)

docs/examples/led_pulse_method.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from picozero import LED
2+
3+
led = LED(14)
4+
5+
led.pulse()

docs/examples/pico_temperature.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Choose View -> Plotter in Thonny to see a graph of the results
22

3-
from time import sleep
43
from picozero import pico_temp_sensor
4+
from time import sleep
55

66
while True:
77
print(pico_temp_sensor.temp)

docs/examples/robot_rover_square.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from picozero import Robot
2-
from time import sleep
32

43
robot_rover = Robot(left=(14,15), right=(12,13))
54

docs/gettingstarted.rst

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
..
33
.. SPDX short identifier: MIT
44
5+
===============
56
Getting started
67
===============
78

9+
Install using Thonny
10+
====================
11+
812
Requirements
913
------------
1014

@@ -20,36 +24,53 @@ Once Thonny is installed, you will need to ensure that you are using the latest
2024

2125
.. _Pico guide: https://learning-admin.raspberrypi.org/en/projects/introduction-to-the-pico/3
2226

23-
Use the MicroPython interpreter
24-
-------------------------------
27+
Select the MicroPython interpreter
28+
----------------------------------
2529

2630
You can change which interpreter you are using in Thonny by selecting the desired option at the bottom right of the screen. Make sure that **MicroPython (Raspberry Pi Pico)** is selected.
2731

2832
.. image:: images/thonny-switch-interpreter.jpg
33+
:alt: Selecting MicroPython (Raspberry Pi Pico) from the interpreter menu in the bottom right of the Thonny IDE
2934

3035
Install picozero from PyPI in Thonny
3136
------------------------------------
3237

3338
To install picozero within Thonny, select **Tools** > **Manage packages...**
3439

3540
.. image:: images/thonny-manage-packages.jpg
41+
:alt: Selecting Manage Packages from the Tools menu in Thonny
3642

3743
Search for `picozero` on PyPI.
3844

3945
.. image:: images/thonny-packages-picozero.jpg
46+
:alt: picozero entered in the Search box of the Manage Packages window in Thonny
4047

4148
Click on **install** to download the package.
4249

4350
.. image:: images/thonny-install-package.jpg
51+
:alt: Information about the picozero package shown in the Manage Packages window
52+
53+
Manual install
54+
==============
55+
56+
picozero can be installed by copying the ``picozero.py`` code to your Raspberry Pi Pico.
57+
58+
Either clone the picozero `GitHub repository`_ or copy the code from the `picozero.py`_ file and save it on your main computer.
59+
60+
.. _GitHub repository: https://github.com/RaspberryPiFoundation/picozero
61+
.. _picozero.py: https://raw.githubusercontent.com/RaspberryPiFoundation/picozero/master/picozero/picozero.py?token=GHSAT0AAAAAABRLTKWZDBSYBE54NJ7AIZ6MYSENI2A
62+
63+
Create a new file called picozero.py, copy code into the file and save it on your Raspberry Pi Pico.
4464

45-
Other install options
46-
---------------------
65+
Copy picozero.py using Thonny
66+
-----------------------------
4767

48-
You can use the Thonny file manager to transfer a ``picozero.py`` file to your Raspberry Pi Pico.
68+
Alternatively, you can use the Thonny file manager to transfer the ``picozero.py`` file to your Raspberry Pi Pico.
4969

5070
In the **View** menu, ensure that the **Files** option has a tick. This will let you see the files.
5171

5272
.. image:: images/thonny-view-files.jpg
73+
:alt: The Files option selected from the View menu
5374

5475
Either clone the picozero `GitHub repository`_ or copy the code from the `picozero.py`_ file and save it on your main computer.
5576

@@ -63,10 +84,12 @@ In Thonny, navigate to the cloned directory or location you saved the file in an
6384
Right click on the file and select the **Upload to /** option. You should see a copy of the ``picozero.py`` file on the Raspberry Pi Pico.
6485

6586
.. image:: images/thonny-upload-files.jpg
87+
:alt: The "Upload to /" option selected in the picozero.py file menu
6688
.. image:: images/thonny-copy-picozero.jpg
89+
:alt: The picozero.py file shown in the Raspberry Pi Pico file viewer.
6790

6891
Write a program to control the onboard LED
69-
------------------------------------------
92+
==========================================
7093

7194
The following code will blink the onboard LED at a frequency of once per second.::
7295

@@ -79,8 +102,8 @@ The following code will blink the onboard LED at a frequency of once per second.
79102
pico_led.off()
80103
sleep(0.5)
81104

82-
Run a program on your computer
83-
------------------------------
105+
Run the program on your computer
106+
--------------------------------
84107

85108
You can choose to run the program from your computer.
86109

@@ -92,8 +115,8 @@ Choose to save the script on **This computer** and provide a filename.
92115

93116
.. image:: images/save-this-computer.png
94117

95-
Run a program on your Raspberry Pi Pico
96-
----------------------------------
118+
Run the program on your Raspberry Pi Pico
119+
-----------------------------------------
97120

98121
You can choose to run the program from the Raspberry Pi Pico.
99122

docs/recipes.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,12 @@ Create a pulse effect:
114114

115115
.. literalinclude:: examples/led_pulse.py
116116

117+
Alternatively, you can use the :meth:`~picozero.LED.pulse` method.
118+
119+
.. literalinclude:: examples/led_pulse_method.py
120+
117121
Buttons
118-
------
122+
-------
119123

120124
You can connect buttons and switches to a Raspberry Pi Pico and detect when they are pressed.
121125

@@ -142,7 +146,7 @@ Turn the :obj:`pico_led` on when a :class:`Button` is pressed and off when it is
142146
.. literalinclude:: examples/button_led.py
143147

144148
RGB LEDs
145-
------
149+
--------
146150

147151
Set colours with an :class:`RGBLED`:
148152

@@ -176,7 +180,7 @@ The default for :meth:`~picozero.RGBLED.cycle` is to cycle from red to green, th
176180
.. literalinclude:: examples/rgb_cycle.py
177181

178182
Potentiometer
179-
---------------
183+
-------------
180184

181185
Print the value, voltage, and percent reported by a potentiometer:
182186

@@ -198,7 +202,7 @@ Control an active buzzer that plays a note when powered:
198202
.. literalinclude:: examples/buzzer.py
199203

200204
Speaker
201-
--------
205+
-------
202206

203207
Control a passive buzzer or speaker that can play different tones or frequencies:
204208

@@ -246,7 +250,7 @@ Move a motor connected via two pins (forward and backward) and a motor controlle
246250
.. literalinclude:: examples/motor_move.py
247251

248252
Robot rover
249-
-------------
253+
-----------
250254

251255
Make a simple two-wheeled robot rover.
252256

0 commit comments

Comments
 (0)