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
// instructions: | |
// 1.) install node.js and npm | |
// 2.) put this file in a folder | |
// 3.) go to this folder in terminal, and install ffi and ref using 'npm install ...' | |
// 4.) execute by typing `node node-ffi-mapper.js` | |
// | |
// note: refers explicitly to libmapper-0.2.dylib so make sure it is on the path! | |
var ref = require('ref'); | |
var ffi = require('ffi'); |
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
// Import Express | |
var express = require("express"); | |
var app = express(); | |
// Import Cors: cross origin resource | |
var cors = require("cors"); | |
app.use(cors()); | |
// Import Mongoose | |
var mongoose = require("mongoose"); |
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
MAX=1700 | |
MID=1500 | |
MIN=1200 | |
sudo pigpiod | |
pigs pfs 18 50 # set pwm freq to 50 hz on BCM18 | |
pigs servo 18 $MID # set servo pulsewidth to MID us on BCM18 | |
sleep 1 | |
pigs servo 18 $MIN # set servo pulsewidth to MIN on BCM18 |
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":"acc6e5cd.bbc508","type":"mcp3008","z":"54a3f28b.3cfa8c","name":"IR Sensor (CH7)","device":"/dev/spidev0.0","mode":"0xF0","interval":"50","x":296.5,"y":59,"wires":[["8497b430.1c4d18"]]},{"id":"f746b842.a8ddf8","type":"inject","z":"54a3f28b.3cfa8c","name":"","topic":"","payload":"start","payloadType":"str","repeat":"","crontab":"","once":true,"x":104,"y":40,"wires":[["acc6e5cd.bbc508"]]},{"id":"e4035cf3.8252d","type":"inject","z":"54a3f28b.3cfa8c","name":"","topic":"","payload":"stop","payloadType":"str","repeat":"","crontab":"","once":false,"x":104.5,"y":76,"wires":[["acc6e5cd.bbc508"]]},{"id":"89defb3b.aa7a88","type":"debug","z":"54a3f28b.3cfa8c","name":"","active":true,"console":"false","complete":"payload","x":605.5,"y":167,"wires":[]},{"id":"8497b430.1c4d18","type":"switch","z":"54a3f28b.3cfa8c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"200","vt":"num"},{"t":"lte","v":"199","vt":"num"}],"checkall":"true","outputs":2,"x":146.5,"y":174,"wires":[["9c4d90ba.a4173"],["c |
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
(* until we figure out how to pass strings to ext commands, this bit is hard coded *) | |
readsensor[_, x_] := | |
(<<"!gpio -x mcp3004:100:0 aread 100") | |
readsensor[_, 0] := | |
(<<"!gpio -x mcp3004:100:0 aread 100") | |
readsensor[_, 1] := | |
(<<"!gpio -x mcp3004:100:0 aread 101") |
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":"1b6d4b38.cc6c95", | |
"type":"tab", | |
"label":"PiPlant" | |
}, | |
{ | |
"id":"7e18a8a7.dea448", | |
"type":"rpi-gpio out", | |
"z":"1b6d4b38.cc6c95", |
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":"7e18a8a7.dea448", | |
"type":"rpi-gpio out", | |
"z":"1b6d4b38.cc6c95", | |
"name":"Relay 1", | |
"pin":"13", | |
"set":true, | |
"level":"0", | |
"out":"out", |
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":"106236e9.a79359", | |
"type":"ui_button", | |
"z":"c7976967.e6bb98", | |
"name":"", | |
"group":"134bfa7c.f58646", | |
"order":1, | |
"width":0, | |
"height":0, |
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":"67e93ae6.080164", | |
"type":"tab", | |
"label":"PySeqControl" | |
}, | |
{ | |
"id":"ff38aa39.6692d8", | |
"type":"osc", | |
"z":"67e93ae6.080164", |
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":"98459436.cfd5b8", | |
"type":"ui_slider", | |
"z":"185b40f6.0c777f", | |
"name":"", | |
"label":"moisture level", | |
"group":"e97b599c.1d6968", | |
"order":1, | |
"width":"5", |