Created
May 31, 2020 20:57
-
-
Save nathankellenicki/7266408802bd7a8678149fbd6584172f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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