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 this code in Arduino | |
for (int i=0; i <NUM_LEDS; i++) | |
{ leds[i] = ColorFromPalette( currentPalette, map(i, 0, NUM_LEDS, 0, 255), brightness, map(i, 0, NUM_LEDS, 0, 255)); | |
} | |
*/ | |
// blend doesn't seem to be implemented/necessary in CRGBPalette, so I left it out | |
// Probably this can be optimized? See questions in comments. | |
CRGB ColorFromPalette( const CRGBPalette256& pal, uint8_t index, uint8_t brightness, uint8_t saturation) |
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
// Gamma table HexaWS2811 placed at the bottom of the code | |
// dim_curve placed at the bottom of the code | |
extern const uint8_t gammaTable[]; | |
extern const uint8_t dim_curve[]; | |
#include "FastLED.h" | |
#define NUM_LEDS 5 | |
#define DATA_PIN 11 |
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
// Check: https://plus.google.com/+KasperKamperman/posts/NmCDNXUVHYs | |
// #include "FastLED.h" | |
uint8_t inputValues[7] = {0, 30, 64, 128, 192, 221, 255}; | |
int contrastValue = 8; | |
void setup() { | |
Serial.begin(57600); |
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
// get a colorname from a random color, for example to use as search string | |
// arrays can be filled with more descriptors | |
// a multidimensional array might be nice. | |
// Kasper Kamperman, 27-01-2015 | |
// make sure the two arrays have the same length and the name describes the colorHex. | |
color [] colorHex = { #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff }; | |
String [] colorName = { "red", "yellow", "green", "cyan", "blue", "purple" }; |
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
// this code is not a working sketch | |
int circularBufferSize; | |
int circularBufferIndex; | |
int [][] circularBuffer; | |
circularBufferSize = 512; | |
circularBufferIndex = 0; | |
circularBuffer = new int [6][circularBufferSize]; |
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
/* | |
Problem. Why I see a light image of me, while I do a difference on exactly the same | |
images. | |
OpenCV for Processing 0.5.2 by Greg Borenstein http://gregborenstein.com | |
Using Java OpenCV 2.4.5.0 | |
Processing 3.0a4 | |
*/ |
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
import org.opencv.core.Mat; | |
import gab.opencv.*; | |
import processing.video.*; | |
Capture video; | |
OpenCV opencv; | |
Mat cvLastFrameMat; | |
Mat cvThisFrameMat; |
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
/* | |
Face Detection example: | |
- including mirror effect | |
- track the position of the face | |
Install the OpenCV for Processing library (Sketch > Import library): | |
https://github.com/atduskgreg/opencv-processing | |
Check also the reference: | |
http://atduskgreg.github.io/opencv-processing/reference/ |
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. | |
Protocol description: | |
https://drive.google.com/file/d/0B3Tn6oRmh71oS3FNQ2hsODVwS1E | |
Arduino code: | |
https://gist.github.com/kasperkamperman/7e827bb481dfcdb4cb52 | |
*/ |
OlderNewer