sudo make install does not do everyhing, so there are some extra steps:
- Create
gpio-manageruser orgpiogroups.sudo useradd --system gpio-manager sudo groupadd --system gpio sudo usermod -aG gpio gpio-manager
sudo usermod -aG gpio $USER
| # SPDX-License-Identifier: MIT | |
| import asyncio | |
| from bleak import BleakScanner | |
| from bleak.uuids import normalize_uuid_16 | |
| LEGO_SHORT_UUID = normalize_uuid_16(0xFD02) | |
| # SPDX-License-Identifier: MIT | |
| # Copyright (c) 2025 David Lechner <dlechner@baylibre.com> | |
| # | |
| # /// script | |
| # dependencies = [ | |
| # "bleak", | |
| # ] | |
| # /// | |
| """ |
| #!/usr/bin/env pybricks-micropython | |
| # SPDX-License-Identifier: MIT | |
| # Copyright (c) 2024 David Lechner <dlechner@baylibre.com> | |
| import math | |
| from pybricks.hubs import EV3Brick | |
| from pybricks.ev3devices import Motor, InfraredSensor | |
| from pybricks.parameters import Port, Direction, Button | |
| from pybricks.tools import wait |
| // ==UserScript== | |
| // @name Pybricks Code Full Screen Editor | |
| // @namespace https://pybricks.com/tampermonkey/full-screen-editor | |
| // @version 1.0.0 | |
| // @description Full screen text editor for Pybricks Code. | |
| // @author David Lechner | |
| // @match https://code.pybricks.com | |
| // @match https://beta.pybricks.com | |
| // @icon https://pybricks.com/favion.ico | |
| // @grant none |
| // ==UserScript== | |
| // @name Square names | |
| // @source https://gist.github.com/dlech/2e0e9304458b9f7b816a59e3f187a04b | |
| // @namespace com.lechnology.chess.squares | |
| // @version 1.0.0 | |
| // @description Display the square names on each square. | |
| // @author David Lechner | |
| // @match https://www.chess.com/* | |
| // @grant none | |
| // ==/UserScript== |
| from pybricks.hubs import PrimeHub | |
| from pybricks.experimental import Remote | |
| from pybricks.pupdevices import Motor | |
| from pybricks.parameters import Button, Port, Direction | |
| from pybricks.robotics import DriveBase | |
| from pybricks.tools import wait | |
| DRIVE_SPEED = 400 | |
| hub = PrimeHub() |
| # SPDX-License-Identifier: MIT | |
| # Copyright (c) 2021 David Lechner <david@pybricks.com> | |
| # A program for LEGO MINDSTORMS Robot Inventor - Gelo | |
| # Developed using MINDSTORMS App v1.3.4 (10.1.0), hub firmware v1.2.01.0103 | |
| # Building instructions: https://www.lego.com/cdn/product-assets/product.bi.additional.main.pdf/51515_Gelo.pdf | |
| # Hub API: https://lego.github.io/MINDSTORMS-Robot-Inventor-hub-API/ |
| """WebSocket server compatible with Pybricks v2.x mailboxes.""" | |
| # Ref: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers | |
| # Ref: https://tools.ietf.org/html/rfc6455 | |
| # Ref: https://github.com/pybricks/pybricks-micropython/blob/v2/bricks/ev3dev/modules/pybricks/messaging.py | |
| # Ref: https://github.com/pybricks/pybricks-micropython/blob/v2/bricks/ev3dev/modules/pybricks/bluetooth.py | |
| # Ref: https://github.com/python/cpython/blob/3.9/Lib/socketserver.py | |
| from ubinascii import b2a_base64 | |
| from uhashlib import sha1 |
| from pybricks.hubs import InventorHub | |
| from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor | |
| from pybricks.parameters import Port, Stop, Color, Button | |
| from pybricks.tools import wait, StopWatch | |
| JINGLE_BELLS = ( | |
| ["B3/4", "B3/4", "B3/2"] * 2 + ["B3/4", "D4/4", "G3/4.", "A3/8", "B3/2.", "R/4"] + | |
| ["C4/4", "C4/4", "C4/4.", "C4/8", "C4/4", "B3/4", "B3/4", "B3/8", "B3/8", | |
| "D4/4", "D4/4", "C4/4", "A3/4", "G3/2.", "R/4"] | |
| ) |