Skip to content

Instantly share code, notes, and snippets.

View jasoncoon's full-sized avatar

Jason Coon jasoncoon

View GitHub Profile
@jasoncoon
jasoncoon / FastLED-Sunrise.ino
Created September 15, 2016 13:38
Simple FastLED "sunrise" example that fades from black to red, orange, yellow, and white.
#include "FastLED.h"
// How many leds in your strip?
#define NUM_LEDS 60
// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
#define DATA_PIN 3
#define CLOCK_PIN 13
@jasoncoon
jasoncoon / NoiseSmearing
Last active February 22, 2024 19:39 — forked from StefanPetrick/NoiseSmearing
Attempt at converting NoiseSmearing by Stefan Petrick to run on smaller matrices.
// NoiseSmearing by Stefan Petrick: https://gist.github.com/StefanPetrick/9ee2f677dbff64e3ba7a
// Attempt at running on smaller matrices by Jason Coon
#include <FastLED.h>
#define LED_PIN 0
#define COLOR_ORDER GRB
#define CHIPSET WS2812B
#define NUM_LEDS 240
#include <SmartMatrix3.h>
#define COLOR_DEPTH 24 // known working: 24, 48 - If the sketch uses type `rgb24` directly, COLOR_DEPTH must be 24
const uint8_t kMatrixWidth = 32; // known working: 32, 64, 96, 128
const uint8_t kMatrixHeight = 32; // known working: 16, 32, 48, 64
const uint8_t kRefreshDepth = 36; // known working: 24, 36, 48
const uint8_t kDmaBufferRows = 4; // known working: 2-4, use 2 to save memory, more to keep from dropping frames and automatically lowering refresh rate
const uint8_t kPanelType = SMARTMATRIX_HUB75_32ROW_MOD16SCAN; // use SMARTMATRIX_HUB75_16ROW_MOD8SCAN for common 16x32 panels
const uint8_t kMatrixOptions = (SMARTMATRIX_OPTIONS_NONE); // see http://docs.pixelmatix.com/SmartMatrix for options
const uint8_t kBackgroundLayerOptions = (SM_BACKGROUND_OPTIONS_NONE);
@jasoncoon
jasoncoon / gist:5dd9f70cbeec97558c30
Created November 24, 2015 21:41 — forked from mtwhitley/gist:e2b04f5a034fac617d9c
FastLED Fire 2012 Demo (2 Strips)
#include <FastLED.h>
#define DATA_PIN 3
#define CLOCK_PIN 2
#define DATA_PIN_2 7
#define CLOCK_PIN_2 6
#define CHIPSET APA102
#define NUM_LEDS 144
#define BRIGHTNESS 100
// Falling Fairies pattern by Jason Coon, November 2015
// https://gist.github.com/jasoncoon/ac9f3a4a3e0c2f02bfed
#include <FastLED.h>
#define LED_PIN 3
#define COLOR_ORDER GRB
#define CHIPSET WS2811
#include "SmartMatrix.h"
#include "FastLED.h"
// FireworksXY
// Quick and dirty 2-D fireworks simulation using FastLED.
//
// Originaly designed an Adafruit 5x8 WS2811 shield, but works fine
// on other XY matricies.
//
// by Mark Kriegsman, July 2013
// "Close Encounters" by Jason Coon
// https://gist.github.com/pup05/d4c935566ec82731fece
//
// The start of the main light bar on the ship in Close Encounters of the Third Kind: https://www.youtube.com/watch?v=S4PYI6TzqYk
// Multiple anti-aliased light bars running in alternating directions, now just needs the pulses of color.
//
// A slight modification of Mark Kriegsman's Anti-aliased light bar example: http://pastebin.com/g8Bxi6zW
// https://plus.google.com/u/0/112916219338292742137/posts/2VYNQgD38Pw
#include <FastLED.h>
@jasoncoon
jasoncoon / BlinkyTile-Simple-Cycle
Created December 25, 2014 20:08
BlinkyTile Simple Cycle Example
// The simplest possible way to talk to a BlinkyTape
import processing.serial.*;
Serial s;
void setup() {
// Connect to the first serial port we can find
// We assume there is a BlinkyTape there
s = new Serial(this, "COM6", 115200);
}
final float WAVE_HEIGHT = 16;
final float SPACING = 1;
final int NUM_BALL = 32;
final int BALL_RADIUS = 1;
int timeStep = 0;
//WAVE_HEIGHT, SPACING, and NUM_BALL all affect the size of the window. BALL_RADIUS does not.
void setup() {
size((int)(WAVE_HEIGHT * 2), (int)(WAVE_HEIGHT * 2));
/*
// Based off code from here - http://www.reddit.com/r/gifs/comments/2on8si/connecting_to_server_so_mesmerizing/cmow0sz
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
var numBalls = 32; // numb balls
var timeStep = 0;
var ballYTravel = 32;
var animationPosX = 0;