1.0.11 • Published 1 year ago

@highflying/circuit-cube v1.0.11

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

@highflying/circuit-cube - A Javascript module to interface with Circuit Cubes.

Announcements

  • v1.0.0 First release
const { PoweredUP } = require("../src");

const poweredUP = new PoweredUP();

poweredUP.on("discover", async (hub) => {
  // Wait to discover a Hub
  console.log(`Discovered ${hub.name}!`);

  await hub.connect(); // Connect to the Hub
  console.log("Connected");

  console.log("name", await hub.getName());
  await hub.setName("GWR");
  console.log("name", await hub.getName());
  console.log("battery level", hub.batteryLevel);

  console.log("voltage", await hub.getVoltage());
  await hub.setPower([250, undefined, -250]);
  await hub.sleep(500);
  await hub.stopAll();
  await hub.sleep(500);
});

poweredUP.scan(); // Start scanning for Hubs
console.log("Scanning for Hubs...");

Documentation

Node.js Installation

Node.js v12.0+ required.

npm install @highflying/circuit-cube --save

node-poweredup uses the Noble BLE library by Sandeep Mistry. On macOS everything should function out of the box. On Linux and Windows there are certain dependencies which may need installed first.

Note: node-poweredup has been tested on macOS 11.0 and Debian/Raspbian on the Raspberry Pi 4 Model B.

Known Issues and Limitations

Credits

Thanks go to Nathan Kellenicki (@nathankellenicki) for node-powered on which this code was originally based.

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago