first working version
This commit is contained in:
21
source/connect.py
Normal file
21
source/connect.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import time
|
||||
import robomaster
|
||||
from robomaster import conn
|
||||
from MyQR import myqr
|
||||
from PIL import Image
|
||||
|
||||
|
||||
QRCODE_NAME = "qrcode.png"
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
helper = conn.ConnectionHelper()
|
||||
info = helper.build_qrcode_string(ssid="ITL@Bs", password="StStefan202!")
|
||||
myqr.run(words=info)
|
||||
time.sleep(1)
|
||||
#img = Image.open(QRCODE_NAME)
|
||||
#img.show()
|
||||
if helper.wait_for_connection():
|
||||
print("Connected!")
|
||||
else:
|
||||
print("Connect failed!")
|
BIN
source/qrcode.png
Normal file
BIN
source/qrcode.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1001 B |
14
source/robot-version.py
Normal file
14
source/robot-version.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from robomaster import robot
|
||||
from robomaster import config
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print("starting program..")
|
||||
ep_robot = robot.Robot()
|
||||
# 指定机器人的 SN 号
|
||||
ep_robot.initialize(conn_type="sta", sn="3JKCK7W0030DRU")
|
||||
|
||||
ep_version = ep_robot.get_version()
|
||||
print("Robot Version: {0}".format(ep_version))
|
||||
|
||||
ep_robot.close()
|
Reference in New Issue
Block a user