Skip to content

A Qt library for controlling LEGO Powered Up devices.

License

Notifications You must be signed in to change notification settings

Symbitic/QtLego

Repository files navigation

QtLego

Action Status

A Qt library for connecting and controlling LEGO® devices.

THIS LIBRARY IS STILL IN ITS INFANCY! IT CAN ONLY HANDLE BASIC CONNECTIONS AND MOTOR COMMANDS!! EXPECT BREAKING CHANGES!!!

BuyMeACoffee

Introduction

QtLego is a library for connecting to LEGO devices and querying and controlling peripherals attached to those devices. Currently only LEGO Powered UP hubs are supported, but it should be possible to add support for Mindstorms and Spike Prime hubs.

Using

API

QLegoDevice

auto scanner = new QLegoDeviceScanner();

QObject::connect(scanner, &QLegoDeviceScanner::deviceFound, [=](QLegoDevice *device) {
  qDebug() << "Address:" << device->address();
  qDebug() << "Firmware:" << device->firmware();
  QTimer::singleShot(10000, device, &QLegoDevice::disconnect); // Disconnect after 10 seconds.
});

See examples/helloworld.cpp for a more complete example.

License

Copyright © Alex Shaw 2021

Source code is licensed under the MIT license.

About

A Qt library for controlling LEGO Powered Up devices.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published