Created
November 26, 2018 04:28
-
-
Save reconbot/2b15385e0381acc11f77ccd2194e4d9b to your computer and use it in GitHub Desktop.
My hanging js codee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules/blynk-library/certs/server.crt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Blynk } = require('blynk-library') | |
const Tessel = require("tessel-io") | |
const five = require("johnny-five") | |
const BLYNK_TOKEN = 'XXXXXX' | |
const board = new five.Board({ | |
io: new Tessel(), | |
repl: false | |
}) | |
const blynk = new Blynk(BLYNK_TOKEN) | |
const v1 = new blynk.VirtualPin(1) | |
const v2 = new blynk.VirtualPin(2) | |
board.on("ready", () => { | |
const monitor = new five.Multi({ | |
controller: "BME280", | |
freq: 1000 | |
}) | |
monitor.hygrometer.on('change', data => { | |
v1.write(data.relativeHumidity) | |
}) | |
monitor.thermometer.on('change', data => { | |
v2.write(data.fahrenheit) | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "basement-humidity", | |
"version": "0.0.0", | |
"description": "basement humidity project", | |
"main": "index.js", | |
"dependencies": { | |
"blynk-library": "^0.5.3", | |
"johnny-five": "^1.0.0", | |
"tessel-io": "^1.2.0" | |
}, | |
"private": true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment