From cd0c4b810836daa91d9ecd1ca5707d87522695d6 Mon Sep 17 00:00:00 2001 From: Brian Jordan Date: Mon, 11 Apr 2016 18:19:32 -0700 Subject: [PATCH] Revert "Add tap and capacitive touch component support" --- apps/src/makerlab/BoardController.js | 25 +++++++------------------ code-studio/package.json | 4 ++-- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/apps/src/makerlab/BoardController.js b/apps/src/makerlab/BoardController.js index 77f032bb439ab..3582cbf8338a0 100644 --- a/apps/src/makerlab/BoardController.js +++ b/apps/src/makerlab/BoardController.js @@ -57,7 +57,7 @@ BoardController.prototype.ensureBoardConnected = function () { BoardController.prototype.installComponentsOnInterpreter = function (codegen, jsInterpreter) { this.prewiredComponents = this.prewiredComponents || - initializeCircuitPlaygroundComponents(this.board_.io); + initializeCircuitPlaygroundComponents(); codegen.customMarshalObjectList = [ {instance: five.Led}, @@ -67,9 +67,7 @@ BoardController.prototype.installComponentsOnInterpreter = function (codegen, js {instance: five.Piezo}, {instance: five.Thermometer}, {instance: five.Sensor}, - {instance: PlaygroundIO.CapTouch}, - {instance: PlaygroundIO.Tap}, - {instance: five.Accelerometer} + {instance: five.Gyro} ]; Object.keys(this.prewiredComponents).forEach(function (key) { @@ -82,12 +80,7 @@ BoardController.prototype.reset = function () { return; } - var standaloneComponents = [ - this.prewiredComponents.tap, - this.prewiredComponents.touch - ]; - - this.board_.register.concat(standaloneComponents).forEach(function (component) { + this.board_.register.forEach(function (component) { try { if (component.state && component.state.intervalId) { clearInterval(component.state.intervalId); @@ -158,7 +151,7 @@ function deviceOnPortAppearsUsable(port) { * Circuit Playground board. * @returns {Object.} board components */ -function initializeCircuitPlaygroundComponents(io) { +function initializeCircuitPlaygroundComponents() { return { pixels: Array.from({length: 10}, function (_, index) { return new five.Led.RGB({ @@ -202,12 +195,8 @@ function initializeCircuitPlaygroundComponents(io) { freq: 100 }), - accelerometer: new five.Accelerometer({ - controller: PlaygroundIO.Accelerometer - }), - - tap: new PlaygroundIO.Tap(io), - - touch: new PlaygroundIO.CapTouch(io) + gyro: new five.Gyro({ + controller: PlaygroundIO.Gyro + }) }; } diff --git a/code-studio/package.json b/code-studio/package.json index fed7d28f5ac92..41ae5c2c0f5c7 100644 --- a/code-studio/package.json +++ b/code-studio/package.json @@ -57,7 +57,7 @@ "factor-bundle": "^2.5.0", "http-server": "^0.9.0", "istanbul": "^0.4.2", - "johnny-five": "^0.9.37", + "johnny-five": "bcjordan/johnny-five#with-firmata-fix", "mkdirp": "^0.5.1", "mocha": "^2.3.4", "mochify": "^2.15.0", @@ -65,7 +65,7 @@ "node-sass": "^3.4.2", "object-assign": "^4.0.1", "phantomjs-prebuilt": "^2.1.3", - "playground-io": "bcjordan/playground-io#tap-cap-touch", + "playground-io": "bcjordan/playground-io#more-components", "radium": "^0.17.1", "recursive-readdir-sync": "^1.0.6", "sass-lint": "^1.4.0",