Skip to content

Commit 64c1d07

Browse files
committed
update2
1 parent a077ff9 commit 64c1d07

13 files changed

Lines changed: 16 additions & 11 deletions

docs/source/dont_touch_me.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ In this project, we will let Pisloth express his little emotions. When you try t
1919
2020
sloth = Sloth([1,2,3,4])
2121
sloth.set_offset([0,0,0,0])
22-
sonar = Ultrasonic(Pin("D0") ,Pin("D1"))
22+
sonar = Ultrasonic(Pin("D2") ,Pin("D3"))
2323
2424
alert_distance = 20
2525
@@ -51,7 +51,7 @@ Instantiate various classes of music, pislot and infrared sensor modules to be u
5151
5252
sloth = Sloth([1,2,3,4])
5353
sloth.set_offset([0,0,0,0])
54-
sonar = Ultrasonic(Pin("D0") ,Pin("D1"))
54+
sonar = Ultrasonic(Pin("D2") ,Pin("D3"))
5555
5656
The ultrasonic module reads the distance between your hand and the Pisloth and sets the judgment condition. When the distance is less than or equal to alert_distance, Pisloth will play the audio file and do ``backward`` and ``stand`` actions.
5757

-3.22 KB
Loading
-36.7 KB
Loading

docs/source/ezblock/img/fight.png

-901 Bytes
Loading

docs/source/ezblock/img/fight5.png

7.69 KB
Loading

docs/source/ezblock/img/fight6.png

5.14 KB
Loading
-90.5 KB
Loading

docs/source/ezblock/lets_fight_warrior_ez.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,17 @@ This block can jump out of the current loop and enter the next loop.
2222

2323
This block can jump out of the entire loop.
2424

25-
.. image:: img/fight4.png
26-
:width: 500
25+
.. image:: img/fight5.png
2726

28-
When the pisloth is too far away from the obstacle or the data is not read due to wire problems, the detected distance will be less than 0. Such a combination of blocks can help us ignore these interferences.
27+
This block can jump out of the current loop and enter the next loop.
28+
29+
.. image:: img/fight6.png
2930

31+
This block can jump out of the entire loop.
3032

3133
**EXAMPLE**
3234

35+
The ultrasonic module cyclically detects the obstacle distance. When ``distance >= 5 and distance <= 40``, the audio file is played and the action ``forward`` is cyclically performed.
36+
When the distance <= 5, Pisloth jumps out of the loop and stops advancing. When the distance < 0, it means that the current distance detection fails, and the loop continues to detect the distance.
37+
3338
.. image:: img/fight.png

docs/source/lets_fight_warrior.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ In this project, we will make Pisloth a warrior who will provoke you, and it wil
1919
2020
sloth = Sloth([1,2,3,4])
2121
sloth.set_offset([0,0,0,0])
22-
sonar = Ultrasonic(Pin("D0") ,Pin("D1"))
22+
sonar = Ultrasonic(Pin("D2") ,Pin("D3"))
2323
2424
alert_distance = 40
2525
contact_distance = 5

docs/source/obstacle_avoidance.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ In this project, Pisloth will use an ultrasonic module to detect obstacles in fr
1919
2020
sloth = Sloth([1,2,3,4])
2121
sloth.set_offset([0,0,0,0])
22-
sonar = Ultrasonic(Pin("D0") ,Pin("D1"))
22+
sonar = Ultrasonic(Pin("D2") ,Pin("D3"))
2323
2424
alert_distance = 10
2525
@@ -58,7 +58,7 @@ Then initialize the ultrasonic pins.
5858

5959
.. code:: python
6060
61-
sonar = Ultrasonic(Pin("D0") ,Pin("D1"))
61+
sonar = Ultrasonic(Pin("D2") ,Pin("D3"))
6262
6363
Read the distance detected by the ultrasonic, set the condition to judge, when the distance is less than ``alert_distance``, play the audio file ``sign.wav``
6464
and let Pisloth do the ``hook``, ``stand``, ``turn left``, ``stand`` actions in sequence. When the distance is greater than ``alert_distance``,

0 commit comments

Comments
 (0)