![Freenove Raspberry Pi 2 Model B Скачать руководство пользователя страница 130](http://html.mh-extra.com/html/freenove/raspberry-pi-2-model-b/raspberry-pi-2-model-b_manual_2330437130.webp)
Need support?
128
Chapter 4 Robot Dog
www.freenove.com
█
Type the following command to enter the directory where myCode.py is located.
cd ~/Freenove_Robot_Dog_Kit_for_Raspberry_Pi/Code/Server
Run myCode.py
sudo python myCode.py
You can see that your robot dog moves forward for 5 steps, then twists its body at 10 degrees to the right,
then 20 degrees to the left, then returns to the original attitude and move forward 5 steps and then stops.
Related py files
Some important functions included in the py files are listed below. If you want to see more detailed code
content, please open the corresponding py file to check directly.
ADS7830.py
Function
Description
power(channel)
Enter 0 to return the battery voltage value.
Buzzer.py
Function
Description
run(command)
Enter 0, then the buzzer will not sound. Enter 1, the buzzer will sound.
Contorl.py
Function
Description
coordinateToAngle(x,y,z)
Enter the foot coordinate then return servo angle of each joint in one
leg.
angleToCoordinate(a,b,c)
Enter the leg joint angle then return the foot coordinate.
Condition()
Execute corresponding action commands
map()
Mapping a value from one range to another
backWard ()
Move backward one step
forward()
Move forward one step
turnLeft()
Turn left one step
turnRight()
Turn right one step
stop()
Stop.
setpLeft()
Move to left one step
setpRight()
Move to right one step
upAndDown()
Adjust height of body
beforeAndAfter()
Make body move forward or backward
Содержание Raspberry Pi 2 Model B
Страница 35: ...Need support support freenove com 33 Chapter 0 Raspberry Pi Preparation www freenove com ...
Страница 71: ...Need support support freenove com 69 Chapter 2 Assemble Robot www freenove com M3 Nut M3x12 ...
Страница 98: ...Need support support freenove com 96 Chapter 4 Robot Dog www freenove com ...
Страница 105: ...Need support support freenove com 103 Chapter 4 Robot Dog www freenove com Installation is successful ...
Страница 111: ...Need support support freenove com 109 Chapter 4 Robot Dog www freenove com Click Continue Click Agree ...