Hello
I'm working on a personal project for sending some websocket message from pico w with micropython.
I use this library aiohttp and I'm trying to send some messsage when a button is pressedWhen I pressed the button message is not sent
Can you help me please ?
I'm working on a personal project for sending some websocket message from pico w with micropython.
I use this library aiohttp and I'm trying to send some messsage when a button is pressed
Code:
async def main(): session = aiohttp.ClientSession() async with session.ws_connect('URL') as ws: await button(ws) async for msg in ws: await button(ws) async def button(ws): while True: player = 'test' if button1.is_pressed: print('button is pressed') player = 'buzzer1' await ws.send_str(player)
Can you help me please ?
Statistics: Posted by wanexa — Tue Jun 25, 2024 3:57 pm