79823785

Date: 2025-11-18 20:13:47
Score: 1
Natty:
Report link

RemoteBrick – The First Java Library for the Original LEGO® SPIKE™ Prime / Robot Inventor Hub (51515)

Because there was simply no Java library that could control the original LEGO® Education Inventor Hub (51515) with its factory firmware, I built RemoteBrick completely from scratch.

Open-source project → https://github.com/juniorjacki/RemoteBrick

Now you can finally write real Java programs for SPIKE™ Prime and Robot Inventor – no flashing, no Pybricks, no workarounds needed.

RemoteBrick communicates directly with the hub via Bluetooth Classic (SPP) and gives you 100 % of the features the official LEGO app has – just in pure Java.

Current Features in v1.3.0:

Quick Start (3 Steps)

  1. Download the latest JAR → Releases
  2. Add the JAR to your Java project (IntelliJ, Eclipse, VS Code, etc.)
  3. Pair your hub in Windows Bluetooth settings and note the MAC address

Example – Connect & Drive

import de.juniorjacki.remotebrick.Hub;
import de.juniorjacki.remotebrick.devices.Motor;
import de.juniorjacki.remotebrick.types.*;


public class Demo {
    public static void main(String[] args) throws InterruptedException {
        try (var hub = Hub.connect("AA:BB:CC:DD:EE:FF")) {  // ← your hub's MAC
            if (hub == null) {
                System.out.println("Connection failed!");
                return;
            }


            Motor left  = (Motor) hub.getDevice(Port.A);
            Motor right = (Motor) hub.getDevice(Port.B);


            // Heartbeat animation + drive forward 3 seconds
            hub.getControl().display().animation(Animation.HEARTBEAT, true).send();
            hub.getControl().move().startSpeeds(left, right, 75, 75, 100).send();
            Thread.sleep(3000);
            hub.getControl().move().stop(left, right, StopType.BRAKE).send();


            System.out.println("Done! Battery: " + hub.getBatteryPercentage() +  "%");
        }
    }
}
Reasons:
  • Contains signature (1):
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: JuniorJacki