Skip to content

Control your LEGO EV3 brick using Direct commands over serial port.

License

Notifications You must be signed in to change notification settings

hKaspy/ev3-direct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ev3 direct

Control your LEGO EV3 brick via direct commands - over Bluetooth, USB or Wi-Fi. Uses node-serialport.

Made in TypeScript!

The control code is an implementation of the official documentation available on the LEGO Mindstorms website - EV3 Firmware Developer Kit and EV3 Communication Developer Kit.

Usage

⚠⚠⚠ This package is not yet published to npm! For the time being you will have to clone this repository. ⚠⚠⚠

Connect your EV3 P-Brick over Bluetooth.

If you don't know the Bluetooth port the P-Brick is connected to, find it by Brick ID:

import { findBrickPort } from "ev3-direct";

findBrickPort("00112233aabb").then((brickPort) => {
    console.log(brickPort);
});

Then send commands to your brick!

import { connectBrickByPort } from "ev3-direct";

connectBrickByPort("COM4").then(async (brick) => {
    return brick.getBrickname();
}).then((resp) => {
    console.log(resp);
}).catch((err) => {
    console.error(err);
});

Advanced usage

The EV3 class has only few basic methods implemented. To implement advanced logic, see custom requests

About

Control your LEGO EV3 brick using Direct commands over serial port.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published