Изменение порта
This commit is contained in:
parent
484e04d0bb
commit
b43920bacc
7
ard.py
7
ard.py
@ -1,10 +1,11 @@
|
|||||||
|
import uvicorn
|
||||||
from serial import Serial
|
from serial import Serial
|
||||||
import threading
|
import threading
|
||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
|
|
||||||
s=""
|
s=""
|
||||||
|
|
||||||
ser = Serial('COM4', 9600)
|
ser = Serial('COM6', 9600)
|
||||||
def pot():
|
def pot():
|
||||||
global s
|
global s
|
||||||
while True:
|
while True:
|
||||||
@ -16,3 +17,7 @@ app = FastAPI()
|
|||||||
@app.get("/")
|
@app.get("/")
|
||||||
async def root():
|
async def root():
|
||||||
return ("message", s)
|
return ("message", s)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
uvicorn.run(app, port=10000)
|
Loading…
Reference in New Issue
Block a user