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
channels = {} -- save pitch per channel# | |
channelNo = {} -- save channel# per pitch | |
function GetFreeChannel() | |
for i = 1, 16 do if channels[i] == nil then return i end end | |
Print("Error: ran out of channels") | |
return 1 | |
end | |
function OnNote(channel, pitch, velocity) |
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
/* | |
Arduino code for homebridge-433-arduino | |
(c) by Normen Hansen, released under MIT license | |
uses code from http://forum.arduino.cc/index.php?topic=396450.0 | |
*/ | |
#include <RCSwitch.h> | |
RCSwitch mySwitch = RCSwitch(); | |
const byte numChars = 255; // max number of received chars | |
char receivedChars[numChars]; // an array to store the received data |
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 http = require('http'); | |
const url = require('url'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const port = process.argv[2] || 9000; | |
http.createServer(function (req, res) { | |
console.log(`${req.method} ${req.url}`); | |
// parse URL | |
const parsedUrl = url.parse(req.url); | |
// extract URL path |