Comment by olegp

2 years ago

A browser based controller for the LEGO Duplo train using the Web Bluetooth API. It works best on mobiles in portrait mode and you can find it here: https://legotrain.netlify.app/

The source is a single HTML file that also contains the JS. Just view source and modify if you're interested in taking this further. What's cool is that the protocol allows you to receive readings from the train and not just send commands. Also, it allows you to drive the train faster than you can via the official mobile app.

Also have a look at Pybricks.com to control LEGO Powered Up devices (trains, Technic, Boost, Mindstorms).