liuk hace 4 años
padre
commit
e9d2dbf8a7
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. 4 4
      trainControl.py

+ 4 - 4
trainControl.py

@@ -14,7 +14,7 @@ ser = None
 #串口打开
 def openSer():
 
-    ser = serial.Serial("COM8", 9600, timeout=0.5)
+    ser = serial.Serial("COM5", 9600, timeout=0.5)
     # 字节大小
     ser.bytesize = 8
     # 无校验
@@ -51,14 +51,14 @@ def start(ser):
         print("火车上报位置信息为 : ", data)
         if data == b'\xc0\x1c\xed\xc0\xb1\xed' or data == b'\xc0\xb1\xed':
             print("火车在左上报")
-            res = requests.get("http://127.0.0.1:8080/api/train/updateTrainLocal?local=l")
+            res = requests.get("http://127.0.0.1:8082/api/train/updateTrainLocal?local=l")
             print(res.text)
         if data == b'\xc0,\xed\xc0\xb2\xed' or data == b'\xc0\xb2\xed':
             print("火车在右上报")
-            res = requests.get("http://127.0.0.1:8080/api/train/updateTrainLocal?local=r")
+            res = requests.get("http://127.0.0.1:8082/api/train/updateTrainLocal?local=r")
             print(res.text)
         if data == b'\xc0\xb1\xedZ\xa5':
-            res = requests.get("http://127.0.0.1:8080/api/train/updateTrainLocal?local=l")
+            res = requests.get("http://127.0.0.1:8082/api/train/updateTrainLocal?local=l")
             print(res.text)
             print("火车复位上报")
         time.sleep(0.1)