This file contains hidden or 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
var net = require('net'); | |
var five = require('johnny-five'); | |
var firmata = require('firmata'); | |
var options = { | |
host: '192.168.2.5', //whatever host | |
port: 48879 //some port | |
}; | |
This file contains hidden or 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
var net = require('net'); | |
var SerialPort = require('serialport').SerialPort; | |
//possibly something like COM1 on windows | |
var SERIAL_PORT = process.env.SERIAL_PORT || '/dev/tty.usbmodem1421'; | |
var PORT = process.env.PORT || 3001; |
This file contains hidden or 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
var SerialPort = require('serialport').SerialPort; | |
var bindPhysical = require('mqtt-serial').bindPhysical; | |
var mqtt = require('mqtt'); | |
// might be something like COM1 on windows | |
var SERIAL_PORT = process.env.SERIAL_PORT || '/dev/tty.usbmodem1421'; | |
var serialPort = new SerialPort(SERIAL_PORT,{ | |
baudrate: 57600, |
This file contains hidden or 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
var net = require('net'); | |
var five = require('johnny-five'); | |
var options = { | |
host: 'localhost', //any tcp host | |
port: 3001 // any port | |
}; | |
var client = net.connect(options); |
This file contains hidden or 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
{ | |
method: 'POST', | |
path: '/dostuff', | |
config: { | |
auth: false, | |
cors: { | |
additionalHeaders: ['accept'] | |
}, | |
handler: handleStuff | |
} |
This file contains hidden or 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
[{"id":"2f8628c2.e692b8","type":"nodebot","z":"10cff070.ef301","name":"","username":"","password":"","boardType":"firmata","serialportName":"","connectionType":"webusb-serial","mqttServer":"","socketServer":"","pubTopic":"","subTopic":"","tcpHost":"","tcpPort":"","sparkId":"","sparkToken":"","beanId":"","impId":"","meshbluServer":"https://meshblu.octoblu.com","uuid":"","token":"","sendUuid":""},{"id":"1b2f064f.b9378a","type":"johnny5","z":"10cff070.ef301","name":"","func":"var r = new five.Pin(9);\nvar g = new five.Pin(11);\nvar b = new five.Pin(10);\n\nvar buttonState;\n\nnode.on('input', function(msg){\n if(msg.payload && msg.payload.buttons){\n var buttons = msg.payload.buttons;\n var updated = !_.isEqual(buttons, buttonState);\n buttonState = buttons;\n if(updated){\n \n if(buttons[9].pressed){\n r.high();\n }\n else{\n r.low();\n }\n \n if(buttons[1].pressed){\n |
This file contains hidden or 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
[{"id":"4721875f.f2b108","type":"voice rec","z":"f9740f89.10f39","name":"","x":93,"y":68,"wires":[["f1138943.020728"]]},{"id":"f1138943.020728","type":"function","z":"f9740f89.10f39","name":"filter speech","func":"var parsed = msg.payload.split(\" \");\nvar match = ['jarvis', 'service', 'nervous', 'travis', 'target'];\n\nif(parsed && parsed.length > 1 && _.includes(match, parsed[0].toLowerCase())){\n parsed.shift();\n var query = parsed.join(' ');\n \n msg.params = {\n q: query,\n cr: 'US',\n cx: '003265628676327108248:v26ein-gdfq',\n num: 10,\n key: ' -- my key --'\n };\n return msg;\n \n}\n\nreturn null;","outputs":1,"noerr":0,"x":226,"y":156,"wires":[["e7caa57f.ff5178"]]},{"id":"e7caa57f.ff5178","type":"http request","z":"f9740f89.10f39","name":"","method":"GET","ret":"txt","url":"https://www.googleapis.com/customsearch/v1","x":317,"y":68,"wires":[["26353cb7.750f34"]]},{"id":"26353cb7.750f34","type":"function","z":"f9740f89.10f39","name":"process resp |
This file contains hidden or 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
/* | |
Firmata is a generic protocol for communicating with microcontrollers | |
from software on a host computer. It is intended to work with | |
any host computer software package. | |
To download a host software package, please clink on the following link | |
to open the list of Firmata client libraries your default browser. | |
https://github.com/firmata/arduino#firmata-client-libraries |
This file contains hidden or 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
[{"id":"1edd1c65.74c624","type":"subflow","name":"key to Hz","info":"","in":[{"x":50,"y":30,"wires":[{"id":"74b957b9.772a98"}]}],"out":[{"x":599,"y":83,"wires":[{"id":"33d59d5d.5fd7d2","port":0}]}]},{"id":"74b957b9.772a98","type":"math","z":"1edd1c65.74c624","name":"","operator":"-","operand":"65","payloadProp":"","resultProp":"","x":237,"y":194,"wires":[["2737e658.96909a"]]},{"id":"2737e658.96909a","type":"math","z":"1edd1c65.74c624","name":"","operator":"/","operand":"12","x":278,"y":136,"wires":[["7b172864.38a918"]]},{"id":"973dda4f.6eeb38","type":"math","z":"1edd1c65.74c624","name":"","operator":"*","operand":"440","x":427,"y":130,"wires":[["33d59d5d.5fd7d2"]]},{"id":"7b172864.38a918","type":"math","z":"1edd1c65.74c624","name":"","operator":"^r","operand":"2","x":348,"y":71,"wires":[["973dda4f.6eeb38"]]},{"id":"33d59d5d.5fd7d2","type":"math","z":"1edd1c65.74c624","name":"","operator":"round","operand":"","payloadProp":"","resultProp":"frequency","x":484,"y":190,"wires":[[]]},{"id":"64371572.bdc03c","type" |
This file contains hidden or 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
[{"id":"DZPR-zf4CIU","type":"bluetooth out","z":"49fb777.a30e588","name":"digital..","characteristicId":"2a56","bleServiceId":"bada5555-e91f-1337-a49b-8675309fb099","x":762.5,"y":358.1666488647461,"wires":[]},{"id":"X6whys0o5ck","type":"bluetooth out","z":"49fb777.a30e588","name":"analog..","characteristicId":"2a58","bleServiceId":"bada5555-e91f-1337-a49b-8675309fb099","x":648.5,"y":791.1666488647461,"wires":[]},{"id":"dUHqkQX4TO0","type":"iot buttons","z":"49fb777.a30e588","x":63.5,"y":331.1666488647461,"wires":[["AtpvgWLC-Ns"]]},{"id":"AtpvgWLC-Ns","type":"switch","z":"49fb777.a30e588","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"3","vt":"num"},{"t":"eq","v":"4","vt":"num"},{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"6","vt":"num"},{"t":"eq","v":"5","vt":"num"},{"t":"eq","v":"7","vt":"num"},{"t":"eq","v":"8","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"true","outputs":8,"x":90.5,"y":485.1666488647461,"wires":[["dVSGiYQQfDw","YkMU_r_YmWs","rY4m-mfS8k8","8-o0yFdbNgU"] |