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
/* | |
Example implementation to receive commands over TCP on your Photon running FastLED animations. | |
FastLED is not implemented you have to do that yourself. | |
It makes use of this Serial cmd protocol concept: | |
https://gist.github.com/kasperkamperman/7e827bb481dfcdb4cb52 | |
See this Processing sketch to send TCP Data. Modify the IPAddress to the local address of the Photon. | |
https://gist.github.com/kasperkamperman/1f185758519fa3131ea0 |
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
/* Use ControlP5 annotations to make a control panel for FastLED. | |
Uses a protocol of 12 bytes. | |
This sends data over TCP to your Photon: | |
Protocol description: | |
https://drive.google.com/file/d/0B3Tn6oRmh71oS3FNQ2hsODVwS1E | |
Particle Photon code: | |
https://gist.github.com/kasperkamperman/89f67f049a2ec45a5c9c |
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
/* | |
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). |
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
/* | |
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 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
/** | |
* OSC receive program | |
* Uses OscP5 library | |
* OSC explanation video: https://youtu.be/0uOR2idKvrM | |
*/ | |
import oscP5.*; | |
import netP5.*; | |
OscP5 oscP5; |
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
/* | |
* 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 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
// 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 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
/* | |
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 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
// 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 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
/* 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 |