-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest1.py
34 lines (23 loc) · 929 Bytes
/
test1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/python
# -*- coding: utf-8 -*-
import time
import RobotApi as api
api.ubtRobotInitialize()
#-----------------------↓ block program start here ↓----------------------
if (getRobotSensorValue("obstacle") < 10):
#raise_hand
api.ubtSetRobotMotion("raise", "left", 3, 1)
#lights_chest.
api.ubtSetRobotLED("button", "red", "blink")
ubtinit.isSetLed = True
#sound_tts.
api.ubtVoiceTTS(0, "距离太近,请靠远点")
if (getRobotSensorValue("obstacle") > 10):
#lights_chest.
api.ubtSetRobotLED("button", "yellow", "blink")
ubtinit.isSetLed = True
#sound_tts.
api.ubtVoiceTTS(0, "谢谢")
#-----------------------↑ block program end ↑----------------------
api.ubtRobotDisconnect("SDK","1","127.0.0.1")
api.ubtRobotDeinitialize()