Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save nathankellenicki/7266408802bd7a8678149fbd6584172f to your computer and use it in GitHub Desktop.

Select an option

Save nathankellenicki/7266408802bd7a8678149fbd6584172f to your computer and use it in GitHub Desktop.
const PoweredUP = require("node-poweredup");
const poweredUP = new PoweredUP.PoweredUP();
poweredUP.scan();
console.log("Looking for Hubs...");
poweredUP.on("discover", async (hub) => {
await hub.connect();
console.log(`Connected to ${hub.name}!`);
const sensor = await hub.waitForDeviceByType(PoweredUP.Consts.DeviceType.TECHNIC_COLOR_SENSOR);
sensor.setBrightness(100, 100, 100);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment