SunFounder PiDog Kit, Release 1.0
(continued from previous page)
# Head Reset
elif
key
==
'm'
:
head_yrp
=
[
0
,
0
,
0
]
my_dog
.
head_move([head_yrp], pitch_comp
=
head_pitch_init,
immediately
=
True
, speed
=
HEAD_SPEED)
else
:
# print('key:', key)
continue
run_command()
# sleep(0.001)
if
__name__
==
"__main__"
:
try
:
main()
(
"
\033
[?25h"
)
# Show terminal cursor
except
Exception
as
e:
raise
e
finally
:
my_dog
.
close()
2.2.13 Play PiDog with APP
In this example, we will use SunFounder Controller APP to control PiDog.
You need to download the APP on your phone/tablet first, then connect to the hotspot sent by PiDog, and finally create
your own remote control on SunFounder Controller to control PiDog.
How to do?
1. Install
from
APP Store(iOS)
or
Google Play(Android)
.
2. Run the Code
cd
/
home
/
pi
/
pidog
/
examples
sudo python3
12
_app_control
.
py
After the code runs, you will see the following prompt, which means your PiDog has successfully
started network communication.
Running on: http:
//
192.168
.
18.138
:
9000
/
mjpg
*
Serving Flask app
"vilib.vilib"
(lazy loading)
*
Environment: development
*
Debug mode: off
*
Running on http:
//
0.0
.
0.0
:
9000
/
(Press CTRL
+
C to quit)
3. Connect
PiDog
and
Sunfounder Controller
.
• Connect your tablet/phone to the WLAN where PiDog is located.
• Open the
Sunfounder Controller
APP. Click the + icon to add a remote.
70
Chapter 2. Play with Python
Summary of Contents for PiDog
Page 1: ...SunFounder PiDog Kit Release 1 0 sunfounder Jan 09 2023 ...
Page 2: ......
Page 4: ...ii ...
Page 6: ...SunFounder PiDog Kit Release 1 0 Content 2 CONTENTS ...
Page 8: ...SunFounder PiDog Kit Release 1 0 4 Chapter 1 Component List and Assembly Instructions ...
Page 15: ...SunFounder PiDog Kit Release 1 0 Step 7 Click the WRITE button 2 1 Quick Guide on Python 11 ...
Page 92: ...SunFounder PiDog Kit Release 1 0 88 Chapter 2 Play with Python ...
Page 108: ...SunFounder PiDog Kit Release 1 0 104 Chapter 4 Appendix ...