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
/* Structure to receive 12 byte commands. | |
* Protocol idea: | |
* https://drive.google.com/file/d/0B3Tn6oRmh71oS3FNQ2hsODVwS1E | |
* | |
* Processing program to send commands: | |
* https://gist.github.com/kasperkamperman/6c7c256f7042a3ca5118 | |
* | |
* Thanks to Daniel Garcia for the command structure example. | |
*/ |
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
// https://developer.spotify.com/web-api/endpoint-reference/ | |
JSONObject json; | |
PImage [] albumCovers; | |
//Bubble[] bubbles; | |
void setup() { | |
size(640,480); |
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
/* Value Monitor Example | |
*/ | |
ValueMonitor [] valueMonitorArray = new ValueMonitor[2]; | |
void setup() { | |
size(640, 480); | |
frameRate(25); | |
// place ValueMonitor objects on the screen, for some graphical feedback |
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
// https://developer.spotify.com/web-api/get-track/ | |
// http://code.compartmental.net/minim/minim_method_loadfile.html | |
import ddf.minim.*; | |
import ddf.minim.effects.*; | |
Minim minim; | |
AudioPlayer groove; | |
void setup() |
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
/* | |
Implementation of a 16bit HSB lookup table. | |
The table is rendered with a Processing sketch where HSB is converted to RGB. | |
*/ | |
#include<FastLED.h> | |
const uint32_t HSBLUT[] = { | |
0xFFFF0000, 0xFFFF0500, 0xFFFF0B00, 0xFFFF1100, 0xFFFF1700, 0xFFFF1D00, 0xFFFF2300, 0xFFFF2900, 0xFFFF2F00, 0xFFFF3500, 0xFFFF3B00, 0xFFFF4100, 0xFFFF4700, 0xFFFF4D00, 0xFFFF5300, 0xFFFF5900, |
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
// sqrt blending test | |
// http://scottsievert.com/blog/2015/04/24/image-sqrt/ | |
// https://plus.google.com/+KasperKamperman/posts/jkACVWijSDN | |
// algorithms sqrt32 from: http://stackoverflow.com/questions/1100090/looking-for-an-efficient-integer-square-root-algorithm-for-arm-thumb2 | |
#include "FastLED.h" | |
// How many leds in your strip? | |
#define NUM_LEDS 128 |
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
/* | |
* oscP5sendreceive by andreas schlegel | |
* example shows how to send and receive osc messages. | |
* oscP5 website at http://www.sojamo.de/oscP5 | |
* modified by Kasper Kamperman | |
* OSC explanation video: https://youtu.be/0uOR2idKvrM | |
*/ | |
import oscP5.*; | |
import netP5.*; |
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
/** | |
* OSC receive program | |
* Uses OscP5 library | |
* OSC explanation video: https://youtu.be/0uOR2idKvrM | |
*/ | |
import oscP5.*; | |
import netP5.*; | |
OscP5 oscP5; |
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
/* | |
Measurement of the FastLED.show() routine. | |
Soft SPI is only supported till now on the Photon. | |
However non-SPI pins seem to be 140us faster then when using the SPI pins. | |
Using those SPI pins in hardware design might be interesting for future compatibility | |
when hardware SPI gets supported. | |
Below the timing test of different pin combinations. The APA102 is updated at 16Mhz. | |
*/ |
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
/* | |
When no packets are received Udp.parsePacket() takes 997us (about 1ms) | |
When a packet is received it takes 17us. | |
I think there is a timeout. It would be nice if we can set that with a function like: setTimeOut (like on Arduino with the Serial port). | |
I'd like to set it on microsecond level. | |
You can try this script by sending for example OSC data (I used TouchOSC). | |
When you receive data it displays a '/' (first character in an OSC string). |