Skip to content

Commit

Permalink
Examples: updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron committed Jun 12, 2020
1 parent fbd7064 commit c5b2d63
Show file tree
Hide file tree
Showing 17 changed files with 59 additions and 18 deletions.
2 changes: 1 addition & 1 deletion eg/altimeter-mpl3115a2.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ board.on("ready", () => {


/* @markdown
- [MPL3115A2 - I2C Barometric Pressure/Altimiter/Temperature Sensor](https://www.adafruit.com/products/1893)
- [MPL3115A2 - I2C Barometric Pressure/Altimiter/Thermometer Sensor](https://www.adafruit.com/products/1893)
- [SparkFun Altitude/Pressure Sensor Breakout - MPL3115A2](https://www.sparkfun.com/products/11084)
- [SparkFun Weather Shield](https://www.sparkfun.com/products/12081)
- [SparkFun Photon Weather Shield](https://www.sparkfun.com/products/13630)
Expand Down
2 changes: 1 addition & 1 deletion eg/barometer-mpl3115a2.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ board.on("ready", () => {
});

/* @markdown
- [MPL3115A2 - I2C Barometric Pressure/Altimiter/Temperature Sensor](https://www.adafruit.com/products/1893)
- [MPL3115A2 - I2C Barometric Pressure/Altimiter/Thermometer Sensor](https://www.adafruit.com/products/1893)
- [SparkFun Altitude/Pressure Sensor Breakout - MPL3115A2](https://www.sparkfun.com/products/11084)
- [SparkFun Weather Shield](https://www.sparkfun.com/products/12081)
- [SparkFun Photon Weather Shield](https://www.sparkfun.com/products/13630)
Expand Down
11 changes: 11 additions & 0 deletions eg/board-collection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { Boards, Led } = require("../lib/johnny-five.js");
const boards = new Boards([
"/dev/tty.usbmodem14101",
"/dev/tty.wchusbserial1420",
]);

const pin = 13;

boards.on("ready", () => {
boards.each(board => new Led({board, pin}).blink());
});
4 changes: 2 additions & 2 deletions eg/grove-humidity-temperature-edison.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ For this program, you'll need:
![Grove Base Shield v2](http://www.seeedstudio.com/depot/images/product/base%20shield%20V2_01.jpg)
![Grove - Temperature&Humidity Sensor (High-Accuracy & Mini)](https://github.com/rwaldron/johnny-five/raw/master/docs/breadboard/multi-TH02.png)
![Grove - Thermometer&Humidity Sensor (High-Accuracy & Mini)](https://github.com/rwaldron/johnny-five/raw/master/docs/breadboard/multi-TH02.png)
- [Grove - Temperature&Humidity Sensor (High-Accuracy & Mini)](http://www.seeedstudio.com/depot/Grove-TemperatureHumidity-Sensor-HighAccuracy-Mini-p-1921.html)
- [Grove - Thermometer&Humidity Sensor (High-Accuracy & Mini)](http://www.seeedstudio.com/depot/Grove-ThermometerHumidity-Sensor-HighAccuracy-Mini-p-1921.html)
@markdown */
4 changes: 2 additions & 2 deletions eg/grove-lcd-rgb-temperature-display-edison.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var board = new five.Board({

board.on("ready", function() {

// Plug the Temperature sensor module
// Plug the Thermometer sensor module
// into the Grove Shield's A0 jack
var thermometer = new five.Thermometer({
controller: "GROVE",
Expand Down Expand Up @@ -63,7 +63,7 @@ For this program, you'll need:
![Grove - LCD RGB w/ Backlight](http://www.seeedstudio.com/wiki/images/0/03/Serial_LEC_RGB_Backlight_Lcd.jpg)
![Grove - Temperature Sensor](http://www.seeedstudio.com/wiki/images/thumb/b/b0/Temperature1.jpg/400px-Temperature1.jpg)
![Grove - Thermometer Sensor](http://www.seeedstudio.com/wiki/images/thumb/b/b0/Thermometer1.jpg/400px-Thermometer1.jpg)
@markdown */
4 changes: 2 additions & 2 deletions eg/grove-lcd-rgb-temperature-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var board = new five.Board();

board.on("ready", function() {

// Plug the Temperature sensor module
// Plug the Thermometer sensor module
// into the Grove Shield's A0 jack
var thermometer = new five.Thermometer({
controller: "GROVE",
Expand Down Expand Up @@ -62,7 +62,7 @@ For this program, you'll need:
![Grove - LCD RGB w/ Backlight](http://www.seeedstudio.com/wiki/images/0/03/Serial_LEC_RGB_Backlight_Lcd.jpg)
![Grove - Temperature Sensor](http://www.seeedstudio.com/wiki/images/thumb/b/b0/Temperature1.jpg/400px-Temperature1.jpg)
![Grove - Thermometer Sensor](http://www.seeedstudio.com/wiki/images/thumb/b/b0/Thermometer1.jpg/400px-Thermometer1.jpg)
@markdown */
2 changes: 1 addition & 1 deletion eg/multi-mpl3115a2.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ board.on("ready", function() {
});

/* @markdown
- [MPL3115A2 - I2C Barometric Pressure/Altimiter/Temperature Sensor](https://www.adafruit.com/products/1893)
- [MPL3115A2 - I2C Barometric Pressure/Altimiter/Thermometer Sensor](https://www.adafruit.com/products/1893)
- [SparkFun Altitude/Pressure Sensor Breakout - MPL3115A2](https://www.sparkfun.com/products/11084)
- [SparkFun Weather Shield](https://www.sparkfun.com/products/12081)
- [SparkFun Photon Weather Shield](https://www.sparkfun.com/products/13630)
Expand Down
30 changes: 30 additions & 0 deletions eg/servo.collection-animation-PCA9685.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const {Animation, Board, Servos} = require("../");
const board = new Board();
const controller = "PCA9685";

board.on("ready", function() {
const servos = new Servos([
{ controller, pin: 0 },
{ controller, pin: 1 },
{ controller, pin: 2 },
{ controller, pin: 3 },
{ controller, pin: 4 },
{ controller, pin: 5 },
]);

const animation = new Animation(servos);

// Create an animation segment object
animation.enqueue({
duration: 2000,
cuePoints: [0, 0.5, 1.0],
keyFrames: [
[{degrees: 0}, {degrees: 180}, {degrees: 150}],
[{degrees: 0}, {degrees: 180}, {degrees: 120}],
[{degrees: 0}, {degrees: 180}, {degrees: 90}],
[{degrees: 0}, {degrees: 180}, {degrees: 60}],
[{degrees: 0}, {degrees: 180}, {degrees: 30}],
[{degrees: 0}, {degrees: 180}, {degrees: 0}],
]
});
});
2 changes: 1 addition & 1 deletion eg/temperature-ds18b20.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ board.on("ready", () => {
});

/* @markdown
- [DS18B20 - Temperature Sensor](http://www.maximintegrated.com/en/products/analog/sensors-and-sensor-interface/DS18S20.html)
- [DS18B20 - Thermometer Sensor](http://www.maximintegrated.com/en/products/analog/sensors-and-sensor-interface/DS18S20.html)
@markdown */
2 changes: 1 addition & 1 deletion eg/temperature-dual-ds18b20.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ board.on("ready", () => {
});

/* @markdown
// - [DS18B20 - Temperature Sensor](http://www.maximintegrated.com/en/products/analog/sensors-and-sensor-interface/DS18S20.html)
// - [DS18B20 - Thermometer Sensor](http://www.maximintegrated.com/en/products/analog/sensors-and-sensor-interface/DS18S20.html)
@markdown */
2 changes: 1 addition & 1 deletion eg/temperature-lm335.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ board.on("ready", () => {
});

/* @markdown
- [LM335 - Temperature Sensor](http://www.ti.com/product/lm335)
- [LM335 - Thermometer Sensor](http://www.ti.com/product/lm335)
@markdown */
2 changes: 1 addition & 1 deletion eg/temperature-lm35.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ board.on("ready", () => {
});

/* @markdown
- [LM35 - Temperature Sensor](http://www.ti.com/product/lm35)
- [LM35 - Thermometer Sensor](http://www.ti.com/product/lm35)
@markdown */
2 changes: 1 addition & 1 deletion eg/temperature-mpl115a2.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ board.on("ready", () => {


/* @markdown
- [MPL115A2 - I2C Barometric Pressure/Temperature Sensor](https://www.adafruit.com/product/992)
- [MPL115A2 - I2C Barometric Pressure/Thermometer Sensor](https://www.adafruit.com/product/992)
@markdown */
2 changes: 1 addition & 1 deletion eg/temperature-mpl3115a2.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ board.on("ready", () => {
});

/* @markdown
- [MPL3115A2 - I2C Barometric Pressure/Altimiter/Temperature Sensor](https://www.adafruit.com/products/1893)
- [MPL3115A2 - I2C Barometric Pressure/Altimiter/Thermometer Sensor](https://www.adafruit.com/products/1893)
- [SparkFun Altitude/Pressure Sensor Breakout - MPL3115A2](https://www.sparkfun.com/products/11084)
- [SparkFun Weather Shield](https://www.sparkfun.com/products/12081)
- [SparkFun Photon Weather Shield](https://www.sparkfun.com/products/13630)
Expand Down
2 changes: 1 addition & 1 deletion eg/temperature-mpu6050.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ board.on("ready", () => {
});

/* @markdown
- [MPU6050 - IMU with Temperature Sensor](http://www.invensense.com/products/motion-tracking/6-axis/mpu-6050/)
- [MPU6050 - IMU with Thermometer Sensor](http://www.invensense.com/products/motion-tracking/6-axis/mpu-6050/)
@markdown */
2 changes: 1 addition & 1 deletion eg/temperature-tmp102.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ board.on("ready", () => {
});

/* @markdown
- [TMP102 - Temperature Sensor](https://www.sparkfun.com/products/11931)
- [TMP102 - Thermometer Sensor](https://www.sparkfun.com/products/11931)
@markdown */
2 changes: 1 addition & 1 deletion eg/temperature-tmp36.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ board.on("ready", () => {
});

/* @markdown
- [TMP36 - Temperature Sensor](https://www.sparkfun.com/products/10988)
- [TMP36 - Thermometer Sensor](https://www.sparkfun.com/products/10988)
@markdown */

0 comments on commit c5b2d63

Please sign in to comment.