From 506b82cda77d4046321a8ce505dd6bfdc5bbd971 Mon Sep 17 00:00:00 2001 From: Nathan Kunicki Date: Tue, 7 Aug 2018 12:33:29 +0100 Subject: [PATCH] Front page usage example --- ABOUT.md | 4 +++- README.md | 4 +++- package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ABOUT.md b/ABOUT.md index cba257b..c71433b 100644 --- a/ABOUT.md +++ b/ABOUT.md @@ -37,7 +37,7 @@ While most Powered UP components and Hubs are compatible with each other, there * Plugging two Boost Tacho Motors into the Powered UP Hub will crash the Hub (This requires a firmware update from LEGO to fix). -### Usage Example +### Usage ```javascript const PoweredUP = require("node-poweredup"); @@ -50,6 +50,8 @@ poweredUP.on("discover", async (hub) => { // Wait to discover a Hub await hub.sleep(1000); // Do nothing for 1 second await hub.setMotorSpeed("A", 75); // Activate a motor attached to port A at 3/4 speed (75) indefinitely }); + +poweredUP.scan(); // Start scanning for Hubs ``` More examples are available in the "examples" directory. diff --git a/README.md b/README.md index abb3aed..b459f5e 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ While most Powered UP components and Hubs are compatible with each other, there * Plugging two Boost Tacho Motors into the Powered UP Hub will crash the Hub (This requires a firmware update from LEGO to fix). -### Usage Example +### Usage ```javascript const PoweredUP = require("node-poweredup"); @@ -50,6 +50,8 @@ poweredUP.on("discover", async (hub) => { // Wait to discover a Hub await hub.sleep(1000); // Do nothing for 1 second await hub.setMotorSpeed("A", 75); // Activate a motor attached to port A at 3/4 speed (75) indefinitely }); + +poweredUP.scan(); // Start scanning for Hubs ``` More examples are available in the "examples" directory. diff --git a/package.json b/package.json index fb15409..59266bd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-poweredup", - "version": "1.0.5", + "version": "1.0.6", "description": "A Node.js module to interface with LEGO Powered UP components.", "homepage": "https://github.com/nathankellenicki/node-poweredup/", "main": "dist/poweredup.js",