SunFounder PiDog Kit, Release 1.0
(continued from previous page)
direction
=
my_dog
.
ears
.
read()
(f
"sound direction: {direction}"
)
2.3.12 Pat the PiDog’s Head
The Touch Swich on the head of PiDog can detect how you touch it. You can call the following functions to use it.
Pidog
.
dual_touch
.
read()
• Touch the module from left to right (front to back for PiDog’s orientation), it will return
"LS"
.
• Touch the module from right to left, it will return
"RS"
.
• Touch the module If the left side of the module is touched, it will return
"L"
.
• If the right side of the module is touched, it will return
"R"
.
• If the module is not touched, it will return
"N"
.
Here is an example of its use:
from
pidog
import
Pidog
import
time
my_dog
=
Pidog()
while
True
:
touch_status
=
my_dog
.
dual_touch
.
read()
(f
"touch_status: {touch_status}"
)
time
.
sleep(
0.5
)
2.3.13 More
The following address will explain the use of PiDog’s more basic functions:
•
Vilib is a library developed by SunFounder for Raspberry Pi camera.
It contains some practical functions, such as taking pictures, video recording, pose detection, face
detection, motion detection, image classification and so on.
•
SunFounder Controller is an application that allows users to customize the controller for controlling
their robot or as an IoT platform.
2.3. Easy Coding
87
Содержание PiDog
Страница 1: ...SunFounder PiDog Kit Release 1 0 sunfounder Jan 09 2023 ...
Страница 2: ......
Страница 4: ...ii ...
Страница 6: ...SunFounder PiDog Kit Release 1 0 Content 2 CONTENTS ...
Страница 8: ...SunFounder PiDog Kit Release 1 0 4 Chapter 1 Component List and Assembly Instructions ...
Страница 15: ...SunFounder PiDog Kit Release 1 0 Step 7 Click the WRITE button 2 1 Quick Guide on Python 11 ...
Страница 92: ...SunFounder PiDog Kit Release 1 0 88 Chapter 2 Play with Python ...
Страница 108: ...SunFounder PiDog Kit Release 1 0 104 Chapter 4 Appendix ...