Skip to content

Instantly share code, notes, and snippets.

// Slightly modified Adalight protocol implementation that uses FastLED
// library (http://fastled.io) for driving WS2811/WS2812 led stripe
// Was tested only with Prismatik software from Lightpack project
#include "FastLED.h"
#define NUM_LEDS 114 // Max LED count
#define LED_PIN 6 // arduino output pin
#define GROUND_PIN 10
#define BRIGHTNESS 255 // maximum brightness
/*
ffmpeg -i "$file" -f s32be -acodec pcm_s32be -ar 44100 -af "volume=0.5" tcp://espip:5522
*/
#include "i2s.h"
#include <ESP8266WiFi.h>
const char* ssid = "***********";
const char* password = "**********";
WiFiServer pcmServer(5522);
static WiFiClient pcmClient;
<?php
/***
* Pull HTML source for given URL and format for output
* 2011 haliphax https://github.com/haliphax
**/
?>
<!DOCTYPE html>
<html>
<head>
<title>Format page as plain text</title>
<canvas id="canvas" width="800" height="256" ></canvas>
<p id="controls">
<input type="button" id="start_button" value="Start">
&nbsp; &nbsp;
<input type="button" id="stop_button" value="Stop">
</p>
<!-- ----------------------------------------------------- -->
<canvas id="canvas" width="512" height="256" ></canvas>
<p id="controls">
<input type="button" id="start_button" value="Start">
&nbsp; &nbsp;
<input type="button" id="stop_button" value="Stop">
</p>
<!-- ----------------------------------------------------- -->
@mwiemarc
mwiemarc / tutorial_30_example_1.html
Created May 19, 2017 00:50 — forked from webapprentice/tutorial_30_example_1.html
Simple example of Web Audio analysis and visualization
<canvas id="canvas" width="512" height="256" ></canvas>
<p id="controls">
<input type="button" id="start_button" value="Start">
&nbsp; &nbsp;
<input type="button" id="stop_button" value="Stop">
</p>
<!-- ----------------------------------------------------- -->
@mwiemarc
mwiemarc / bitcolor.js
Created May 14, 2017 18:31 — forked from lrvick/bitcolor.js
Javascript functions for doing fast binary/hex/RGB color conversions using bitwise operations.
// convert 0..255 R,G,B values to binary string
RGBToBin = function(r,g,b){
var bin = r << 16 | g << 8 | b;
return (function(h){
return new Array(25-h.length).join("0")+h
})(bin.toString(2))
}
// convert 0..255 R,G,B values to a hexidecimal color string
RGBToHex = function(r,g,b){
@mwiemarc
mwiemarc / color-conversion-algorithms.js
Created May 14, 2017 01:49 — forked from mjackson/color-conversion-algorithms.js
RGB, HSV, and HSL color conversion algorithms in JavaScript
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
* @param Number g The green color value
* @param Number b The blue color value
* @return Array The HSL representation
@mwiemarc
mwiemarc / HexRGB.ino
Created May 13, 2017 11:23 — forked from hsiboy/HexRGB.ino
FastLED - read value from given pixel and convert to hex RGB
long HexRGB = ((long)leds[i].r << 16) | ((long)leds[i].g << 8 ) | (long)leds[i].b; // get value and convert.
Serial.println("Hex: 0x" + String(HexRGB, HEX));
@mwiemarc
mwiemarc / stickynotes_install.sh
Created April 21, 2017 21:21 — forked from trdlo/stickynotes_install.sh
sticky_notes install @ nginx
# http://sayakb.github.io/sticky-notes/pages/install/
# https://github.com/sayakb/sticky-notes
mkdir /var/www/paste && cd /var/www/paste.domain.tld && git clone https://github.com/sayakb/sticky-notes.git .
chown -Rv www-data:www-data /var/www/paste
cp stickynotes_nginx.conf /etc/nginx/sites-enabled/paste.domain.tld
ln -s /etc/nginx/sites-available/paste.domain.tld /etc/nginx/sites-enabled/.
/etc/init.d/nginx reload
cd /var/www/paste.domain.tld/app/config
mv database.sample.php database.php