Been a while since I have been here buggin you all.

Been a while since I have been here buggin you all.
I have an adafruit trinket and I am trying to get it to do more than just cycle my whole strip through colors. It’s all I ever managed to understand how to program.
I have found code examples but they all require serial.
Anyone know of a some places I could get code to get my lights to chase/cylon/rainbow without serial?

Running of a pattern does not require serial, the serial statements are probably just debug information. If you are looking to be able to change what pattern is running, you can use things like simple buttons to move your code to the next pattern, colour palate etc and dials for speed, brightness etc

Tried the DemoReel100 example?

Just comment out every mention of serial and youll be set to go. Being able to switch through modes with a button is rather simple i have a few patterns running on an Attiny85 which has very little memory

Heres one i wrote you should be able to run it on a trinket no problem

Make sure both header files are in the same folder! I like to use header files to keep things neat :slight_smile:

@Cristian_Martinez C:\Users\joshd\Documents\Arduino\sketch_oct28c\sketch_oct28c.ino:13:22: fatal error: Patterns.h: No such file or directory

#include “Patterns.h”
@Jason_Coon still get serial error

When you opened it did it ask you to create a folder? If so thats why youre getting the error

Simply move both header files from the folder you extracted to the fiolder you just created

Or better yet on the folder you extracted from the zip file just remove the -master at the end of the name and open the arduino sketch again should compile just fine

@Cristian_Martinez Sketch too big. lol

Lol by how much?

@Josh_Dulcich oh. Right… Adafruit. Their bootloader uses up around 3kb of memory leaving you only 5kb. Well atleast you get an idea ofwhat a non-Serial sketch would look like lol

Just remove some patterns and you should be set. Mess around with the demo reel sketch its a great place to start

Trying to get this to work. Have I removed too much?

#include “FastLED.h”

#define DATA_PIN 0
#define LED_TYPE WS2811
#define COLOR_ORDER RGB
#define NUM_LEDS 37
CRGB leds[NUM_LEDS];
#define BRIGHTNESS 96
#define FRAMES_PER_SECOND 120

void setup() {
delay(3000);
FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
FastLED.setBrightness(BRIGHTNESS);
}

uint8_t gHue = 0;
#define ARRAY_SIZE(A) (sizeof(A) / sizeof((A)[0]))

void loop()
{
// a colored dot sweeping back and forth, with fading trails
fadeToBlackBy( leds, NUM_LEDS, 20);
int pos = beatsin16( 13, 0, NUM_LEDS-1 );
leds[pos] += CHSV( gHue, 255, 192);
}

Got it! but oddly pixel 11 and 12 just stay on. the right color. But just on.

#include <Adafruit_NeoPixel.h>
#define LEDPIN 0 // connect the Data from the strip to this pin on the Arduino
#define NUMBER_PIEXELS 37 // the number of pixels in your LED strip
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMBER_PIEXELS, LEDPIN, NEO_GRB + NEO_KHZ800);

int delayTime = 100;

void setup() {
strip.begin(); // initialize the strip
}

void loop() {
theaterChase(strip.Color(127,0, 0), delayTime); // green
theaterChase(strip.Color(102, 205, 0), delayTime); // white
theaterChase(strip.Color(0, 127, 127), delayTime); // purple
}

// Theatre-style crawling lights with a spacing of 3
void theaterChase(uint32_t color, uint8_t wait) {
for (int j=0; j<10; j++) { //do 10 cycles of chasing
for (int q=0; q < 4; q++) {
for (int i=0; i < strip.numPixels(); i=i+4) {
strip.setPixelColor(q+i, color); //turn every third pixel on
}
strip.show();
delay(wait);
for (int i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(q+i, 0); //turn every third pixel off
}
}
}
}

it’s actually EVERY 11th and 12th pixel that just stays on. The math must be bad…

anyone know how to fix the math?

Thats not FastLED :wink: