Skip to content

Instantly share code, notes, and snippets.

void confettiandsinelon()
{
// a colored dot sweeping back and forth, with fading trails
fadeToBlackBy( leds, NUM_LEDS, 10);
int pos1 = beatsin16(4, 0, NUM_LEDS - 1); //beats_per_minute, uint16_t lowest=0, uint16_t highest=65535, uint32_t timebase=0, uint16_t phase_offset=0
leds[pos1] += CHSV( gHue, 255, 192);
int pos2 = random16(NUM_LEDS);
int pos3 = random16(NUM_LEDS);
int pos4 = random16(NUM_LEDS);
EVERY_N_MILLIS(200) {
/***************************************************************************
Example sketch for the MPU9250_WE library
This sketch shows how to obtain raw accleration data and g values from
the MPU9250.
For further information visit my blog:
//Setup the output PWM pin
const int outputPin = 9;
// The number of Steps between the output being on and off
const int pwmIntervals = 100;
// The R value in the graph equation
float R;
void setup() {
#include <FastLED.h>
#define LED_PIN 10
#define NUM_LEDS 300
#define BRIGHTNESS 55
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
#include <FastLED.h>
#define LED_PIN 10
#define NUM_LEDS 300
#define BRIGHTNESS 55
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
CRGB base[NUM_LEDS];
int8_t delta = 1; // 1 or -1. (Negative value reverses direction.)
#define RATE 20 //how fast patern moves (smaller number is faster)
//uint16_t StartPosition = 3;
//uint16_t pos = 0; // A pixel position.
void JellyFishBase() {
fill_solid( base, NUM_LEDS, CRGB::Red); // base color
# include <FastLED.h>
CRGBPalette16 sweep = CRGBPalette16(
CRGB::Blue,
CRGB::Green,
CRGB::Green,
CRGB::Green,
CRGB::Green,
CRGB::Green,
CRGB::Green,
@nervusvagus
nervusvagus / Moving simple patterns edit
Last active August 8, 2018 20:20
Moving simple patterns
//***************************************************************
// Moving simple pattern
// It will wrap around, and the direction can be reversed.
// This is done a bit different then you might expect as I'm
// filling a seperate CRGB array with the custom colors/pattern
// just once in setup(). Then coping that into the main leds
// array as needed when moving it around. There are certanly
// fancier ways to do this, but this gets a simple pattern like
// going quickly.
//
@nervusvagus
nervusvagus / movermemoryissue
Created August 8, 2018 19:58
mover example using 101% of Arduino Nano memory
/* mover-
By: Andrew Tuline
Date: February 2015
This is a simple pixel moving routine for those of you that just like to count pixels on a strand.
I prefer to use sine waves as they provide a LOT of flexibility with less code for moving pixels around.