触摸输入的API¶
检查A1触摸盘的状态:touch_A1;有效值为True或False,当A1触摸盘被触摸时为True,否则为False。用法如下:
1 2 3 4 5 6 7 | import time
from hiibot_circle import hbc
while True:
if hbc.touch_A1: # 判断A1触摸盘是否被触摸
print("A1 be touched")
time.sleep(0.1)
|
检查A2触摸盘的状态:touch_A2;有效值为True或False,当A2触摸盘被触摸时为True,否则为False。用法如下:
1 2 3 4 5 6 7 | import time
from hiibot_circle import hbc
while True:
if hbc.touch_A2: # 判断A2触摸盘是否被触摸
print("A2 be touched")
time.sleep(0.1)
|
检查A3触摸盘的状态:touch_A3;有效值为True或False,当A3触摸盘被触摸时为True,否则为False。用法如下:
1 2 3 4 5 6 7 | import time
from hiibot_circle import hbc
while True:
if hbc.touch_A3: # 判断A3触摸盘是否被触摸
print("A3 be touched")
time.sleep(0.1)
|
检查A4触摸盘的状态:touch_A4;有效值为True或False,当A4触摸盘被触摸时为True,否则为False。用法如下:
1 2 3 4 5 6 7 | import time
from hiibot_circle import hbc
while True:
if hbc.touch_A4: # 判断A4触摸盘是否被触摸
print("A4 be touched")
time.sleep(0.1)
|
检查A5触摸盘的状态:touch_A5;有效值为True或False,当A5触摸盘被触摸时为True,否则为False。用法如下:
1 2 3 4 5 6 7 | import time
from hiibot_circle import hbc
while True:
if hbc.touch_A5: # 判断A5触摸盘是否被触摸
print("A5 be touched")
time.sleep(0.1)
|
检查A6触摸盘的状态:touch_A6;有效值为True或False,当A6触摸盘被触摸时为True,否则为False。用法如下:
1 2 3 4 5 6 7 | import time
from hiibot_circle import hbc
while True:
if hbc.touch_A6: # 判断A6触摸盘是否被触摸
print("A6 be touched")
time.sleep(0.1)
|
检查A7触摸盘的状态:touch_A7;有效值为True或False,当A7触摸盘被触摸时为True,否则为False。用法如下:
1 2 3 4 5 6 7 | import time
from hiibot_circle import hbc
while True:
if hbc.touch_A7: # 判断A7触摸盘是否被触摸
print("A7 be touched")
time.sleep(0.1)
|