Skip to content

Commit

Permalink
fix some errors
Browse files Browse the repository at this point in the history
  • Loading branch information
xiemeiping committed Sep 2, 2022
1 parent dd155ff commit 188a1a6
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 18 deletions.
3 changes: 3 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@
<a href="https://docs.sunfounder.com/projects/sf-controller/en/latest/" target="_blank">SunFounder Control</a>
.. |link_micropython| raw:: html
<a href="https://en.wikipedia.org/wiki/MicroPython" target="_blank">MicroPython - Wikipedia</a>
"""
2 changes: 1 addition & 1 deletion docs/source/get_started/app_control.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ In order for Pico-4wd to be able to run specific scripts without being connected

.. image:: img/app_control14.png

#. Press ``Ctrl+Shift+S`` and select **Raspberry Pi Pico** in the popup window that appears. If this pop-up does not appear on yours, make sure you have plugged the Pico into your computer with a micro USB cable and select the "MicroPython (Raspberry Pi Pico).COMXX" interpreter in the bottom right corner.
#. Stop the script from running and click **File** -> **Save as** or press ``Ctrl+Shift+S``, then select **Raspberry Pi Pico** in the popup window that appears. If this pop-up does not appear on yours, make sure you have plugged the Pico into your computer with a micro USB cable and select the "MicroPython (Raspberry Pi Pico).COMXX" interpreter in the bottom right corner.

.. image:: img/app_control2.png

Expand Down
6 changes: 5 additions & 1 deletion docs/source/get_started/example_donot_push_me.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ In this example, the car will be dormant. If you push it to a cliff, it will be

#. To enable Pico-4wd to run this code on boot, you need to save ``donot_push_me.py`` to the Raspberry Pi Pico as ``main.py``, as follows.

* Keep the ``donot_push_me.py`` file open, then press ``Ctrl+Shift+S`` and select **Raspberry Pi Pico** in the popup window that appears.
* Stop the script from running and click **File** -> **Save as**.

.. image:: img/do_push5.png

* Select **Raspberry Pi Pico** in the popup window that appears.

.. image:: img/do_push2.png

Expand Down
2 changes: 1 addition & 1 deletion docs/source/get_started/example_follow_hand.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Here, Pico-4wd will follow your hand moving forward.

.. image:: img/bull_fight1.png

#. Press ``Ctrl+Shift+S`` to save ``donot_push_me.py`` to the Raspberry Pi Pico as ``main.py``.
#. Click **File** -> **Save as** or press ``Ctrl+Shift+S`` to save ``donot_push_me.py`` to the Raspberry Pi Pico as ``main.py``.

.. image:: img/bull_fight2.png

Expand Down
10 changes: 5 additions & 5 deletions docs/source/get_started/example_line_track.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ Line Track
Let Pico-4wd walk on its exclusive avenue! Tape a line on a light-colored ground (or table) with black insulating tape. Run this script and you will see Pico-4wd track the line to forward.

.. warning::
You should not have too small an angle when pasting the line so that the trolley cannot pass.
When pasting this line, there should be no sharp turns so that the car does not drive off the path.


There are some little eggs in this script: when the Pico-4wd is going straight, the taillight (the RGB panel at the rear) will light up green; when turning, one side of the taillight will light up yellow.
In sharp turns, the taillight will light up red on one side.


**How to do?**
Expand All @@ -24,15 +23,16 @@ In sharp turns, the taillight will light up red on one side.
car.GRAYSCALE_LINE_REFERENCE = 10000
#. Press ``Ctrl+Shift+S``, and then select **Raspberry Pi Pico** in the popup window that appears.
#. Click **File** -> **Save as** or press ``Ctrl+Shift+S``, and then select **Raspberry Pi Pico** in the popup window that appears.

.. image:: img/line_track2.png

#. Set the file name to ``main.py``. If you already have the ``main.py`` file in your Pico, it will prompt to overwrite the ``main.py`` file.

.. image:: img/line_track3.png

#. Now you can unplug the USB cable, place the car on the taped track, turn on the power switch and it will track the line.
#. Now you can unplug the USB cable, place the car on the taped line, turn on the power switch and it will track the line. The script also includes some lighting effects: when the Pico-4wd is going straight, the taillight (the RGB panel on the tail) will light up green; when turning, one side of the taillight will light up yellow.
During sharp turns, one side of the taillight will light up red.


**How it Works?**
Expand Down
2 changes: 1 addition & 1 deletion docs/source/get_started/example_obstacle_avoid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Let Pico-4wd do a challenging task: automatically avoid obstacles! When an obsta

.. image:: img/obs_avoid1.png

#. Press ``Ctrl+Shift+S`` to save ``donot_push_me.py`` to the Raspberry Pi Pico as ``main.py``.
#. Click **File** -> **Save as** or press ``Ctrl+Shift+S`` to save ``donot_push_me.py`` to the Raspberry Pi Pico as ``main.py``.

.. image:: img/obs_avoid2.png

Expand Down
Binary file added docs/source/get_started/img/do_push5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 12 additions & 5 deletions docs/source/get_started/install_micropython_to_pico.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@
2. Install MicroPython on Your Pico
==========================================

MicroPython is a full implementation of the Python 3 programming language that runs directly on embedded hardware like Raspberry Pi Pico. You get an interactive prompt (the REPL) to execute commands immediately via USB Serial, and a built-in filesystem. The Pico port of MicroPython includes modules for accessing low-level chip-specific hardware.
MicroPython is a software implementation of a programming language largely compatible with Python 3, written in C, that is optimized to run on a microcontroller.

* Reference: `MicroPython - Wikipedia <https://en.wikipedia.org/wiki/MicroPython>`_
MicroPython consists of a Python compiler to bytecode and a runtime interpreter of that bytecode. The user is presented with an interactive prompt (the REPL) to execute supported commands immediately. Included are a selection of core Python libraries; MicroPython includes modules which give the programmer access to low-level hardware.

Now to install MicroPython for Raspberry Pi Pico, Raspberry Pi officially provides a |link_micropython_pi|, by dragging ``rp2_pico_xxxx.uf2`` onto the Pico to complete the installation of MicroPython.
* Reference: |link_micropython|


Now come to install MicroPython into Raspberry Pi Pico, Thonny IDE provides a very convenient way for you to install it with one click.



.. note::
If you do not wish to upgrade Thonny, you can use the Raspberry Pi official |link_micropython_pi| by dragging and dropping an ``rp2_pico_xxxx.uf2`` file into Raspberry Pi Pico.


Thonny provides a simpler way, the tutorial is as follows

#. Open Thonny IDE.

Expand All @@ -36,4 +43,4 @@ Thonny provides a simpler way, the tutorial is as follows
.. image:: img/set_pico4.png


Now that your Pico is ready to go, you can continue with the following steps.
Congratulations, now your Raspberry Pi Pico is ready to go.
2 changes: 1 addition & 1 deletion docs/source/get_started/test_the_modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Test the Servo

.. image:: img/run_test_servo.png

Insert a rocker arm first to observe the rotation of the servo. Once the code has been run, the servo will rotate left and right once and then stop at 0°.
Insert a rocker arm first to observe the rotation of the servo. After clicking on the Run button, the servo will rotate left and right once and then stop at 0°.

.. note::
For the next chapter, :ref:`assemble_the_car`, the servo must be held at 0°, so after this code run, do not turn the servo shaft until the car is complete.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/get_started/upload_libraries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Before using Pico-4wd Car, you need to upload its related libraries in Raspberry
#. Download the relevant code from the link below.


* :download:`SunFounder Pico-4wd Car Code <https://github.com/sunfounder/pico_4wd_car_main/archive/refs/heads/main.zip>`
* :download:`SunFounder Pico-4wd Car Code <https://github.com/sunfounder/pico_4wd_car/archive/refs/heads/main.zip>`


#. Open Thonny IDE and plug the Pico into your computer with a micro USB cable and click on the "MicroPython (Raspberry Pi Pico).COMXX" interpreter in the bottom right corner.
Expand All @@ -21,7 +21,7 @@ Before using Pico-4wd Car, you need to upload its related libraries in Raspberry

.. image:: img/th_files.png

#. Switch the path to the folder where you downloaded the `code package <https://github.com/sunfounder/pico_4wd_car_main/archive/refs/heads/main.zip>`_ before, and then go to the ``pico_4wd_car_main/libs`` folder.
#. Switch the path to the folder where you downloaded the `code package <https://github.com/sunfounder/pico_4wd_car/archive/refs/heads/main.zip>`_ before, and then go to the ``pico_4wd_car_main/libs`` folder.

.. image:: img/th_path.png

Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The steps are as follows.

**Source Code**

:download:`SunFounder Pico-4wd Car Code<https://github.com/sunfounder/pico_4wd_car_main/archive/refs/heads/main.zip>`
:download:`SunFounder Pico-4wd Car Code <https://github.com/sunfounder/pico_4wd_car/archive/refs/heads/main.zip>`

Or check out the code at |link_pico_4wd_github|

Expand Down

0 comments on commit 188a1a6

Please sign in to comment.