Skip to content

Commit

Permalink
⚗️ #1 Able to get the ultrasonic feed with FastAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
Balaji-Ganesh committed Jun 14, 2023
1 parent e99be95 commit fd51171
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions System/ESP32_communicator/fastapi_as_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from fastapi import FastAPI
import asyncio
import websockets

app = FastAPI()

url = 'ws://192.168.157.165:82'

@app.get('/collision-distance')
async def listen():
async with websockets.connect(url) as ws:
while True:
msg = await ws.recv()
print("collsion distance: ", msg)

0 comments on commit fd51171

Please sign in to comment.