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
Содержание 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 ...