SunFounder PiDog Kit, Release 1.0
like
pidog\examples
. After modifying the code, you can run it directly to see the effect.
#!/usr/bin/env python3
from
pidog
import
Pidog
from
time
import
sleep
from
preset_actions
import
pushup, bark
my_dog
=
Pidog()
sleep(
0.5
)
def
main
():
my_dog
.
legs_move([[
45
,
-
25
,
-
45
,
25
,
80
,
70
,
-
80
,
-
70
]], speed
=
90
)
my_dog
.
head_move([[
0
,
0
,
-
20
]], speed
=
90
)
my_dog
.
wait_all_done()
sleep(
0.2
)
bark(my_dog, [
0
,
0
,
-
20
])
sleep(
0.1
)
bark(my_dog, [
0
,
0
,
-
20
])
sleep(
1
)
while
True
:
pushup(my_dog)
bark(my_dog, [
0
,
0
,
-
40
])
sleep(
0.4
)
if
__name__
==
"__main__"
:
try
:
main()
except
KeyboardInterrupt
:
my_dog
.
close()
2.2.10 Howling
PiDog is not only a cute puppy, but also a mighty dog. Come hear it howl!
Run the Code
cd
/
home
/
pi
/
pidog
/
examples
sudo python3
9
_howling
.
py
After the program runs, PiDog will sit on the ground and howl.
Code
Note:
You can
Modify/Reset/Copy/Run/Stop
the code below. But before that, you need to go to source code path
like
pidog\examples
. After modifying the code, you can run it directly to see the effect.
2.2. Funny Project
61
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 ...