Skip to content

Instantly share code, notes, and snippets.

View jasoncoon's full-sized avatar

Jason Coon jasoncoon

View GitHub Profile
@todbot
todbot / fake_vectorscope2_lissajous.py
Last active November 1, 2023 09:08
a little fakey vectorscope lissajous display in CircuitPython for 2023HackadaySupercon
# fake_vectorscope2_lissajous.py -- a little fakey vectorscope in CircuitPython for 2023HackadaySupercon
# 21 Oct 2023 - @todbot / Tod Kurt#
# video demo: https://mastodon.social/@todbot/111279891762130663
import time, math, random
import board, busio
import displayio, vectorio
import gc9a01
displayio.release_displays()
@StefanPetrick
StefanPetrick / basic_render_engine_v01
Last active December 8, 2023 02:50
Demo code for Stefans FastLED tutorial #2. It's a 2d render engine for procedural animations v0.1
// Polar basics demo for the
// FastLED Podcast #2
// https://www.youtube.com/watch?v=KKjFRZFBUrQ
//
// VO.1 preview version
// by Stefan Petrick 2023
// This code is licenced under a
// Creative Commons Attribution
// License CC BY-NC 3.0
bl_info = {
"name": "Polar Zonohedron",
"author": "Rob Bell, Garrett Mace",
"version": (1, 0),
"blender": (2, 80, 0),
"location": "View3D > Add > Mesh > Polar Zonohedron",
"description": "Adds a new Polar Zonohedron",
"warning": "",
"wiki_url": "",
"category": "Add Mesh",
@kriegsman
kriegsman / Pacifica.ino
Last active January 27, 2024 04:25
Pacifica: gentle, blue-green ocean waves. For Dan.
//
// "Pacifica"
// Gentle, blue-green ocean waves.
// December 2019, Mark Kriegsman and Mary Corey March.
// For Dan.
//
#define FASTLED_ALLOW_INTERRUPTS 0
#include <FastLED.h>
FASTLED_USING_NAMESPACE
/*
FastLED Fire 2018 by Stefan Petrick
The visual effect highly depends on the framerate.
In the Youtube video it runs at arround 70 fps.
https://www.youtube.com/watch?v=SWMu-a9pbyk
The heatmap movement is independend from the framerate.
The actual scaling operation is not.
@StefanPetrick
StefanPetrick / noise_noise.ino
Last active September 11, 2023 14:05
FastLED simplex noise and colormapping fully modulated by itself
void noise_noise1() {
CRGBPalette16 Pal( pit );
/* here is how the palette looks like:
DEFINE_GRADIENT_PALETTE( pit ) {
0, 3, 3, 3,
64, 13, 13, 255, // blue
128, 3, 3, 3,
192, 255, 130, 3, // orange
// as showed on youtube
void noise_audio2() {
read_audio();
CRGBPalette16 Pal( pit3 ); // the red one
y[0] += (bands[4] - 10) * 4;
scale_x[0] = 10000 - (bands[0] * 40);
scale_y[0] = scale_x[0];
byte layer = 0;
for (uint8_t i = 0; i < Width; i++) {
uint32_t ioffset = scale_x[layer] * (i - CentreX);
@mtwhitley
mtwhitley / gist:e2b04f5a034fac617d9c
Created October 13, 2015 22:00
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
@kriegsman
kriegsman / ColorWavesWithPalettes.ino
Created August 19, 2015 01:24
ColorWavesWithPalettes - demo of using cpt-city palettes in FastLED code
#include "FastLED.h"
// ColorWavesWithPalettes
// Animated shifting color waves, with several cross-fading color palettes.
// by Mark Kriegsman, August 2015
//
// Color palettes courtesy of cpt-city and its contributors:
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/
//
// Color palettes converted for FastLED using "PaletteKnife" v1:
@adammhaile
adammhaile / FastLEDDisk.ino
Last active November 27, 2020 03:11
Examples of using angle and radius to select pixels on a circular pixel layout using FastLED
#include "FastLED.h"
#define NUM_LEDS 255
#define DATA_PIN SPI_DATA
#define CLOCK_PIN SPI_CLOCK
// Define the array of leds
CRGB leds[NUM_LEDS];