Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/symbitic/qtlego
A Qt library for controlling LEGO Powered Up devices.
https://github.com/symbitic/qtlego
Last synced: about 1 month ago
JSON representation
A Qt library for controlling LEGO Powered Up devices.
- Host: GitHub
- URL: https://github.com/symbitic/qtlego
- Owner: Symbitic
- License: mit
- Created: 2021-03-24T16:31:59.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-24T16:32:28.000Z (almost 4 years ago)
- Last Synced: 2024-08-18T00:55:30.148Z (4 months ago)
- Language: C++
- Size: 22.5 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# QtLego
[![Action Status](https://github.com/Symbitic/QtLego/workflows/build/badge.svg)](https://github.com/Symbitic/QtLego/actions)
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](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoff.ee/qh0rXkiCd)
## 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
```c++
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](./examples/helloworld.cpp) for a more complete example.
## License
Copyright © Alex Shaw 2021
Source code is licensed under the [MIT](LICENSE.md) license.