Skip to content

Commit

Permalink
Examples: regenerate
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron committed Aug 23, 2019
1 parent 3dfb616 commit 5933b18
Show file tree
Hide file tree
Showing 15 changed files with 110 additions and 161 deletions.
20 changes: 10 additions & 10 deletions docs/proximity-EVS_EV3_IR-alert.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ node eg/proximity-EVS_EV3_IR-alert.js


```javascript
var five = require("johnny-five");
var board = new five.Board();

board.on("ready", function() {
var red = new five.Led(10);
var green = new five.Led(11);
var leds = new five.Leds([red, green]);
var proximity = new five.Proximity({
const {Board, Led, Leds, Proximity} = require("johnny-five");
const board = new Board();

board.on("ready", () => {
const proximity = new Proximity({
controller: "EVS_EV3_IR",
pin: "BAS1"
});
const red = new Led(10);
const green = new Led(11);
const leds = new Leds([red, green]);

green.on();

proximity.on("change", function() {
if (this.cm < 35) {
proximity.on("change", () => {
if (proximity.cm < 35) {
if (!red.isOn) {
leds.toggle();
}
Expand Down
18 changes: 7 additions & 11 deletions docs/proximity-EVS_EV3_IR.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,21 @@ node eg/proximity-EVS_EV3_IR.js


```javascript
var five = require("johnny-five");
var board = new five.Board();
const {Board, Proximity} = require("johnny-five");
const board = new Board();

board.on("ready", function() {
var proximity = new five.Proximity({
board.on("ready", () => {
const proximity = new Proximity({
controller: "EVS_EV3_IR",
pin: "BBS1"
});

proximity.on("data", function() {
proximity.on("change", () => {
console.log("Proximity: ");
console.log(" cm : ", this.cm);
console.log(" in : ", this.in);
console.log(" cm : ", proximity.cm);
console.log(" in : ", proximity.in);
console.log("-----------------");
});

proximity.on("change", function() {
console.log("The obstruction has moved.");
});
});

```
Expand Down
20 changes: 10 additions & 10 deletions docs/proximity-EVS_EV3_US-alert.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ node eg/proximity-EVS_EV3_US-alert.js


```javascript
var five = require("johnny-five");
var board = new five.Board();

board.on("ready", function() {
var red = new five.Led(10);
var green = new five.Led(11);
var leds = new five.Leds([red, green]);
var proximity = new five.Proximity({
const {Board, Led, Leds, Proximity} = require("johnny-five");
const board = new Board();

board.on("ready", () => {
const proximity = new Proximity({
controller: "EVS_EV3_US",
pin: "BAS1"
});
const red = new Led(10);
const green = new Led(11);
const leds = new Leds([red, green]);

green.on();

proximity.on("change", function() {
if (this.cm < 25) {
proximity.on("change", () => {
if (proximity.cm < 25) {
if (!red.isOn) {
leds.toggle();
}
Expand Down
18 changes: 7 additions & 11 deletions docs/proximity-EVS_EV3_US.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,21 @@ node eg/proximity-EVS_EV3_US.js


```javascript
var five = require("johnny-five");
var board = new five.Board();
const {Board, Proximity} = require("johnny-five");
const board = new Board();

board.on("ready", function() {
var proximity = new five.Proximity({
board.on("ready", () => {
const proximity = new Proximity({
controller: "EVS_EV3_US",
pin: "BBS1"
});

proximity.on("data", function() {
proximity.on("change", () => {
console.log("Proximity: ");
console.log(" cm : ", this.cm);
console.log(" in : ", this.in);
console.log(" cm : ", proximity.cm);
console.log(" in : ", proximity.in);
console.log("-----------------");
});

proximity.on("change", function() {
console.log("The obstruction has moved.");
});
});

```
Expand Down
18 changes: 7 additions & 11 deletions docs/proximity-GP2Y0A710K0F.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,21 @@ node eg/proximity-GP2Y0A710K0F.js


```javascript
var five = require("johnny-five");
var board = new five.Board();
const {Board, Proximity} = require("johnny-five");
const board = new Board();

board.on("ready", function() {
var proximity = new five.Proximity({
board.on("ready", () => {
const proximity = new Proximity({
controller: "GP2Y0A710K0F",
pin: "A0"
});

proximity.on("data", function() {
proximity.on("change", () => {
console.log("Proximity: ");
console.log(" cm : ", this.cm);
console.log(" in : ", this.in);
console.log(" cm : ", proximity.cm);
console.log(" in : ", proximity.in);
console.log("-----------------");
});

proximity.on("change", function() {
console.log("The obstruction has moved.");
});
});

```
Expand Down
18 changes: 7 additions & 11 deletions docs/proximity-hcsr04-analog.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,21 @@ node eg/proximity-hcsr04-analog.js


```javascript
var five = require("johnny-five");
var board = new five.Board();
const {Board, Proximity} = require("johnny-five");
const board = new Board();

board.on("ready", function() {
var proximity = new five.Proximity({
board.on("ready", () => {
const proximity = new Proximity({
controller: "HCSR04",
pin: "A0"
});

proximity.on("data", function() {
proximity.on("change", () => {
console.log("Proximity: ");
console.log(" cm : ", this.cm);
console.log(" in : ", this.in);
console.log(" cm : ", proximity.cm);
console.log(" in : ", proximity.in);
console.log("-----------------");
});

proximity.on("change", function() {
console.log("The obstruction has moved.");
});
});

```
Expand Down
18 changes: 7 additions & 11 deletions docs/proximity-hcsr04-i2c.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,21 @@ node eg/proximity-hcsr04-i2c.js


```javascript
var five = require("johnny-five");
var board = new five.Board();
const {Board, Proximity} = require("johnny-five");
const board = new Board();

board.on("ready", function() {
var proximity = new five.Proximity({
board.on("ready", () => {
const proximity = new Proximity({
controller: "HCSR04I2CBACKPACK",
freq: 100,
});

proximity.on("data", function() {
proximity.on("change", () => {
console.log("Proximity: ");
console.log(" cm : ", this.cm);
console.log(" in : ", this.in);
console.log(" cm : ", proximity.cm);
console.log(" in : ", proximity.in);
console.log("-----------------");
});

proximity.on("change", function() {
console.log("The obstruction has moved.");
});
});

```
Expand Down
18 changes: 7 additions & 11 deletions docs/proximity-hcsr04.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,21 @@ node eg/proximity-hcsr04.js


```javascript
var five = require("johnny-five");
var board = new five.Board();
const {Board, Proximity} = require("johnny-five");
const board = new Board();

board.on("ready", function() {
var proximity = new five.Proximity({
board.on("ready", () => {
const proximity = new Proximity({
controller: "HCSR04",
pin: 7
});

proximity.on("data", function() {
proximity.on("change", () => {
console.log("Proximity: ");
console.log(" cm : ", this.cm);
console.log(" in : ", this.in);
console.log(" cm : ", proximity.cm);
console.log(" in : ", proximity.in);
console.log("-----------------");
});

proximity.on("change", function() {
console.log("The obstruction has moved.");
});
});

```
Expand Down
18 changes: 7 additions & 11 deletions docs/proximity-lidarlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,20 @@ node eg/proximity-lidarlite.js


```javascript
var five = require("johnny-five");
var board = new five.Board();
const {Board, Proximity} = require("johnny-five");
const board = new Board();

board.on("ready", function() {
var proximity = new five.Proximity({
board.on("ready", () => {
const proximity = new Proximity({
controller: "LIDARLITE"
});

proximity.on("data", function() {
proximity.on("change", () => {
console.log("Proximity: ");
console.log(" cm : ", this.cm);
console.log(" in : ", this.in);
console.log(" cm : ", proximity.cm);
console.log(" in : ", proximity.in);
console.log("-----------------");
});

proximity.on("change", function() {
console.log(this.cm + "cm");
});
});

```
Expand Down
18 changes: 7 additions & 11 deletions docs/proximity-mb1000.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,21 @@ node eg/proximity-mb1000.js


```javascript
var five = require("johnny-five");
var board = new five.Board();
const {Board, Proximity} = require("johnny-five");
const board = new Board();

board.on("ready", function() {
var proximity = new five.Proximity({
board.on("ready", () => {
const proximity = new Proximity({
controller: "MB1000",
pin: "A0"
});

proximity.on("data", function() {
proximity.on("change", () => {
console.log("Proximity: ");
console.log(" cm : ", this.cm);
console.log(" in : ", this.in);
console.log(" cm : ", proximity.cm);
console.log(" in : ", proximity.in);
console.log("-----------------");
});

proximity.on("change", function() {
console.log("The obstruction has moved.");
});
});

```
Expand Down
18 changes: 7 additions & 11 deletions docs/proximity-mb1003.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,21 @@ node eg/proximity-mb1003.js


```javascript
var five = require("johnny-five");
var board = new five.Board();
const {Board, Proximity} = require("johnny-five");
const board = new Board();

board.on("ready", function() {
var proximity = new five.Proximity({
board.on("ready", () => {
const proximity = new Proximity({
controller: "MB1003",
pin: "A0"
});

proximity.on("data", function() {
proximity.on("change", () => {
console.log("Proximity: ");
console.log(" cm : ", this.cm);
console.log(" in : ", this.in);
console.log(" cm : ", proximity.cm);
console.log(" in : ", proximity.in);
console.log("-----------------");
});

proximity.on("change", function() {
console.log("The obstruction has moved.");
});
});

```
Expand Down
18 changes: 7 additions & 11 deletions docs/proximity-mb1010.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,21 @@ node eg/proximity-mb1010.js


```javascript
var five = require("johnny-five");
var board = new five.Board();
const {Board, Proximity} = require("johnny-five");
const board = new Board();

board.on("ready", function() {
var proximity = new five.Proximity({
board.on("ready", () => {
const proximity = new Proximity({
controller: "MB1010",
pin: "A0"
});

proximity.on("data", function() {
proximity.on("change", () => {
console.log("Proximity: ");
console.log(" cm : ", this.cm);
console.log(" in : ", this.in);
console.log(" cm : ", proximity.cm);
console.log(" in : ", proximity.in);
console.log("-----------------");
});

proximity.on("change", function() {
console.log("The obstruction has moved.");
});
});

```
Expand Down
Loading

0 comments on commit 5933b18

Please sign in to comment.