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()
print("\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 SunFounder Controller 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