Skip to content

Instantly share code, notes, and snippets.

@johnty
johnty / thermocouple_esp32.ino
Created August 25, 2017 19:05
simple ESP32 max6675 thermocouple webserver
#include <WiFi.h>
#include "max6675.h" //todo: move to global install?
const char* ssid = "xxxxx";
const char* password = "xxxxx";
unsigned long t_prev;
WiFiServer server(80);
@johnty
johnty / MQTTtest.json
Created June 7, 2017 21:13
node-red MQTT roundtrip latency calculator
[
{
"id": "e0241b25.e1c018",
"type": "mqtt in",
"z": "eeecba5a.679b68",
"name": "",
"topic": "/pishield/pingtest2",
"qos": "1",
"broker": "858b78cb.00a038",
"x": 194,
@johnty
johnty / arp.py
Created May 30, 2017 16:16
simple OSC-controlled MIDI arpeggiator that takes in tempo, direction, and key. uses mido and pyOSC
#!/usr/bin/env python
"""
Send random notes to the output port.
"""
from __future__ import print_function
import sys
import time
import random
import mido
import threading
@johnty
johnty / MoistureMusicMap.json
Last active May 30, 2017 19:40
maps single moisture value (0-100) to tempo and key variables of a simple algorithmic sequencer
[
{
"id":"98459436.cfd5b8",
"type":"ui_slider",
"z":"185b40f6.0c777f",
"name":"",
"label":"moisture level",
"group":"e97b599c.1d6968",
"order":1,
"width":"5",
@johnty
johnty / PySeqControl.json
Created May 18, 2017 17:56
pysequencer control node-red flow. requires node-red-contrib-osc
[
{
"id":"67e93ae6.080164",
"type":"tab",
"label":"PySeqControl"
},
{
"id":"ff38aa39.6692d8",
"type":"osc",
"z":"67e93ae6.080164",
@johnty
johnty / node-red-keyboard
Created April 25, 2017 22:20
play a midi keyboard with node-red
[
{
"id":"106236e9.a79359",
"type":"ui_button",
"z":"c7976967.e6bb98",
"name":"",
"group":"134bfa7c.f58646",
"order":1,
"width":0,
"height":0,
@johnty
johnty / PiPlant_gauge.json
Created April 25, 2017 21:44
PiPlant flow with FRED integration and servo driver for physical gauge
[
{
"id":"7e18a8a7.dea448",
"type":"rpi-gpio out",
"z":"1b6d4b38.cc6c95",
"name":"Relay 1",
"pin":"13",
"set":true,
"level":"0",
"out":"out",
@johnty
johnty / PiPlant.json
Created April 18, 2017 17:42
PiPlant flow
[
{
"id":"1b6d4b38.cc6c95",
"type":"tab",
"label":"PiPlant"
},
{
"id":"7e18a8a7.dea448",
"type":"rpi-gpio out",
"z":"1b6d4b38.cc6c95",
@johnty
johnty / PiShield.m
Created April 6, 2017 18:00
Wolfram Connected Device Driver for PiShield A2D (MCP3008), using wiringpi GPIO command
(* 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")
@johnty
johnty / PiPeopleCounter.json
Created December 22, 2016 21:21
pishield node-red people counter + photo taking
[{"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