My hanging js codee
node_modules/blynk-library/certs/server.crt |
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) | |
}) | |
}) |
{ | |
"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