User Manual
Table Of Contents
- 1. Premise
- 2. Raspberry Pi System Installation and Developmen
- 3 Log In to The Raspberry Pi and Install The App
- 4 Raspberry Pi Structure Assembly and Precautions
- 5 Controlling A Robot via WEB App
- 6 Common Problems and Solutions(Q&A)
- 7 Set The Program to Start Automatically
- 8 Remote Operation of Raspberry Pi Via MobaXterm
- 9 How to Control WS2812 RGB LED
- 10 How to Control The Servo
- 11 Calling the API to Control the Robot
- 12 Automatic Stabilization Function
- 13 Gait Generation Method of A Hexapod Robot
- 14 Make A Police Light or Breathing Light
- 15 Real-Time Video Transmission
- 16 Why OpenCV Uses Multi-threading to Process Vide
- 17 OpenCV Learn to Use OpenCV
- 18 Using OpenCV to Realize Color Recognition and T
- 19 Machine Line Tracking Based on OpenCV
- 20 Create A WiFi Hotspot on The Raspberry Pi
- 21 Install GUI Dependent Item under Window
- 22 How to Use GUI
- 23 Enable UART
- 24 Control Your Adeept_RaspClaws with An Android D
- Conclusion
72
def robotCtrl(command_input, response):
global direction_command, turn_command
if 'forward' == command_input: #move forward
direction_command = 'forward'
move.commandInput(direction_command) #move backward
elif 'backward' == command_input:
direction_command = 'backward'
move.commandInput(direction_command)
elif 'DS' in command_input: #stop
direction_command = 'stand'
move.commandInput(direction_command)
elif 'left' == command_input: #turn left
turn_command = 'left'
move.commandInput(turn_command)
elif 'right' == command_input: #turn right
turn_command = 'right'
move.commandInput(turn_command)
elif 'TS' in command_input: #stop
turn_command = 'no'
move.commandInput(turn_command)
elif 'lookleft' == command_input: # the platform turns left
P_sc.singleServo(12, 1, 7)
elif 'lookright' == command_input: #the platform turns right
P_sc.singleServo(12,-1, 7)
elif 'LRstop' in command_input: #the platform stops turning left and right
P_sc.stopWiggle()
elif 'up' == command_input: #platform turns upward
T_sc.singleServo(13, -1, 7)
elif 'down' == command_input: #platform turns downward
T_sc.singleServo(13, 1, 7)
elif 'UDstop' in command_input: #the platform stops turning up and down
T_sc.stopWiggle()