francescomasala / WRO-Buonarr-2021

Official repository for the ITT Buonarroti - WRO 2021 Challenge
0 stars 2 forks source link

Creating a base test library #1

Open francescomasala opened 3 years ago

francescomasala commented 3 years ago

As the lego EV3 blocks avoid crashing into each other, we need to create a network consisting of a server and multiple clients connected to each other via bluetooth.

The key milestones are:

francescomasala commented 3 years ago

And I have to do the wiki, obviously

francescomasala commented 3 years ago

Update: I've found the async lib

#!/usr/bin/env pybricks-micropython
import uasyncio as asyncio

async def bar():
    count = 0
    while True:
        count += 1
        print(count)
        await asyncio.sleep(1)  # Pause 1s

loop = asyncio.get_event_loop()
loop.create_task(bar()) # Schedule ASAP
loop.run_forever()
francescomasala commented 3 years ago
Starting: brickrun --directory="/home/robot/Programs" "/home/robot/Programs/Server.py"
----------
INFO: Lego Mailbox Server: Obtaining MAC Address: 00:17:E9:B5:77:B0
DEBUG: Lego Mailbox Server: Setting the maximum number of clients to: 1
INFO: Lego Mailbox Server: Initiating the mail server
DEBUG: Lego Mailbox Server: Creating a Boolean Mailbox with name: Client-0
DEBUG: Lego Mailbox Server: Creating a Boolean Mailbox with name: Client-1
DEBUG: Lego Mailbox Server: Creating a Textual Mailbox with name: Blue-Intersection
DEBUG: Lego Mailbox Server: Creating a Textual Mailbox with name: Green-Intersection
INFO: Lego Mailbox Server: Start listening to potential EV3 clients
INFO: Lego Mailbox Server: Clients connected!
INFO: Lego Mailbox Server: Start listening to the Mailbox: BlueIntersection
INFO: Lego Mailbox Server: New message in mailbox: Blue-Intersection : Prova da 00:17:E9:B6:7D:E9
francescomasala commented 3 years ago

To Do: