Skip to content

Commit

Permalink
Examples: add lsm303c program to tpl/programs.json and regenerate exa…
Browse files Browse the repository at this point in the history
…mples list
  • Loading branch information
rwaldron committed Feb 20, 2018
1 parent 59bcf34 commit e99b14c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ To get you up and running quickly, we provide a variety of examples for using ea

To interactively navigate the examples, visit the [Johnny-Five examples](http://johnny-five.io/examples/) page on the official website. If you want to link directly to the examples in this repo, you can use one of the following links.

**There are presently 358 example programs with code and diagrams!**
**There are presently 359 example programs with code and diagrams!**

<!--extract-start:examples-->

Expand Down Expand Up @@ -375,6 +375,7 @@ To interactively navigate the examples, visit the [Johnny-Five examples](http://
### IMU/Multi
- [IMU - BNO055](https://github.com/rwaldron/johnny-five/blob/master/docs/imu-bno055.md)
- [IMU - BNO055 (Orientation)](https://github.com/rwaldron/johnny-five/blob/master/docs/imu-bno055-orientation.md)
- [IMU - LSM303C](https://github.com/rwaldron/johnny-five/blob/master/docs/imu-lsm303c.md)
- [IMU - MPU6050](https://github.com/rwaldron/johnny-five/blob/master/docs/imu-mpu6050.md)
- [Multi - BME280](https://github.com/rwaldron/johnny-five/blob/master/docs/multi-BME280.md)
- [Multi - BMP085](https://github.com/rwaldron/johnny-five/blob/master/docs/multi-bmp085.md)
Expand Down
6 changes: 4 additions & 2 deletions docs/imu-lsm303c.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ board.on("ready", function() {

imu.on("change", function() {

if (Math.random() > 0.05) return;
if (Math.random() > 0.05) {
return;
}

if (this.accelerometer) {
console.log("Accelerometer");
Expand Down Expand Up @@ -104,7 +106,6 @@ board.on("ready", function() {
});
});


```


Expand All @@ -113,6 +114,7 @@ board.on("ready", function() {




&nbsp;

<!--remove-start-->
Expand Down
4 changes: 3 additions & 1 deletion eg/imu-lsm303c.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ board.on("ready", function() {

imu.on("change", function() {

if (Math.random() > 0.05) return;
if (Math.random() > 0.05) {
return;
}

if (this.accelerometer) {
console.log("Accelerometer");
Expand Down
4 changes: 4 additions & 0 deletions tpl/programs.json
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,10 @@
"topic": "IMU/Multi",
"classes": ["IMU", "Multi"],
"examples": [
{
"file": "imu-lsm303c.js",
"title": "IMU - LSM303C"
},
{
"file": "imu-mpu6050.js",
"title": "IMU - MPU6050"
Expand Down

0 comments on commit e99b14c

Please sign in to comment.