1

The Pybricks documentation has a page for "custom devices", with a picture that shows circuit boards with Lego compatible cables attached. Additionally, the class that goes along with the picture seems to be used to handle generic devices. This implies its possible to make custom electronic devices for use with powered up stuff, but I can't find anything about it in the docs or on the net in general. Does anyone know anything about this? Apologies if I mess up any terminology, I'm very new to all of this.

Edit: the page in question in the docs is https://docs.pybricks.com/en/stable/iodevices/pupdevice.html

1
  • 1
    This is very specific to pybricks, so I suggest you try github.com/pybricks/support first. Otherwise it's a bit unclear what you asking. Do you want to know if custom (e.g. arduino-based) devices exist, or do you want to know how to make them? Commented Oct 23, 2023 at 23:52

1 Answer 1

4

The Pybricks PUPDevice class works with any device that supports the LEGO Powered UP (PUP) protocol. If you manage to implement that protocol on some other device like a Pyboard, OpenMV or Arduino, the hub will recognize it as a sensor and receive its data.

The picture you referenced shows a generic device, as well as the bottom half of the Ultrasonic Sensor. This device has two screws in the back that you can remove to reveal 6 breakout pins.

Generic Powered Up device

Here are several example projects that make use of it. Example code to implement that protocol is here. These projects show how to do it in Python, but ultimately the protocol referenced above is on top of UART, and could be implemented on Arduino systems too.

All of this would be a bit easier if Pybricks supported plain UART (so you could skip the protocol). You can upvote that particular feature request here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.