Coder Social home page Coder Social logo

adrianotiger / neopixel-effect-generator Goto Github PK

View Code? Open in Web Editor NEW
76.0 76.0 25.0 611 KB

Online editor to generate Arduino code for neopixel ledstrips without programming knowledge

Home Page: https://adrianotiger.github.io/Neopixel-Effect-Generator/

License: GNU General Public License v3.0

CSS 15.97% HTML 7.54% JavaScript 76.50%

neopixel-effect-generator's People

Contributors

adrianotiger avatar dallinbeutler avatar jmmzzei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neopixel-effect-generator's Issues

Effects as functions

Hello,

I'd like to know if it is possible to turn the effects into functions (like voids) and call them whenever I want.
I'm sorry for the question here but I could not do it by myself.

Thanks in advance.

Feature request please

Hi there, I was wondering if it possible to request some features?

I would love to use some neo pixels in my automotive tail light projects and your animations are great.

Is it possible for the following please:

Allow animations confined to just a "part" of the strip
Asign the arduino analoug inputs to activate certain animations?

Is it also posible for this to work on windows or is it a web interface only?

Thank you for creating and thank you for taking time to read this!

Craig.

several sub loops definition issue

thank you for this helpfull tool!

I just found a small issue when creating 2 loops inside a main loop.

loops definition in the generated code are:
struct Loop strip0loop0(3, false, 1);
struct Loop strip0loop00(1, false, 10);
struct Loop strip0loop00(2, false, 10);

I guess it should be like that :
struct Loop strip0loop0(3, false, 1);
struct Loop strip0loop00(1, false, 10);
struct Loop strip0loop01(2, false, 10);

Fade blinks between Start and End values

It seems that no matter what settings of "Duration", "Delay" and "Every nth LED" I try, I cannot get the code generated by the web UI perform a fade - it just blinks the end-value for a split second on a loop.

Matrix support

Are there plans to support Neopixel matrices? Or are there tools that already exist?

Fade will not allow adruino ide to compile

Code from Fade:

#include <Adafruit_NeoPixel.h>

class Strip
{
public:
  uint8_t   effect;
  uint8_t   effects;
  uint16_t  effStep;
  unsigned long effStart;
  Adafruit_NeoPixel strip;
  Strip(uint16_t leds, uint8_t pin, uint8_t toteffects) : strip(leds, pin, NEO_GRB + NEO_KHZ800) {
    effect = -1;
    effects = toteffects;
    Reset();
  }
  void Reset(){
    effStep = 0;
    effect = (effect + 1) % effects;
    effStart = millis();
  }
};

struct Loop
{
  uint8_t currentChild;
  uint8_t childs;
  bool timeBased;
  uint16_t cycles;
  uint16_t currentTime;
  Loop(uint8_t totchilds, bool timebased, uint16_t tottime) {currentTime=0;currentChild=0;childs=totchilds;timeBased=timebased;cycles=tottime;}
};

Strip strip_0(60, 8, 60 );
struct Loop strip0loop0(1, false, 1);

//[GLOBAL_VARIABLES]

void setup() {

  //Your setup here:

  strip_0.strip.begin();
}

void loop() {

  //Your code here:

  strips_loop();
}

void strips_loop() {
  if(strip0_loop0() & 0x01)
    strip_0.strip.show();
}

uint8_t strip0_loop0() {
  uint8_t ret = 0x00;
  switch(strip0loop0.currentChild) {
    case 0: 
           ret = strip0_loop0_eff0();break;
  }
  if(ret & 0x02) {
    ret &= 0xfd;
    if(strip0loop0.currentChild + 1 >= strip0loop0.childs) {
      strip0loop0.currentChild = 0;
      if(++strip0loop0.currentTime >= strip0loop0.cycles) {strip0loop0.currentTime = 0; ret |= 0x02;}
    }
    else {
      strip0loop0.currentChild++;
    }
  };
  return ret;
}

uint8_t strip0_loop0_eff0() {
  if(millis() - strip_0.effStart < 11 * (strip_0.effStep)) return 0x00;
  uint8_t e,r,g,b;
    e = (strip_0.effStep * 11) / 840;
    r = 121 * ( e ) + 0 * ( 1.0 - e );
    g = 0 * ( e ) + 0 * ( 1.0 - e );
    b = 140 * ( e ) + 0 * ( 1.0 - e );
    for(uint16_t j=0;j<60;j++) {
      if((j % 1) == 0)
        /*strip_0.strip.setPixelColor(j, r, g, b)*/;
      else
        strip_0.strip.setPixelColor(j, 0, 0, 0);
    }
  }
  if(strip_0.effStep >= 76.36363636363636) {strip_0.Reset(); return 0x03; }
  else strip_0.effStep++;
  return 0x01;
}


error:
Arduino: 1.8.8 (Windows Store 1.8.19.0) (Windows 10), Board: "Arduino/Genuino Uno"

sketch_dec25c:90:3: error: expected unqualified-id before 'if'
if(strip_0.effStep >= 76.36363636363636) {strip_0.Reset(); return 0x03; }
^
sketch_dec25c:91:3: error: expected unqualified-id before 'else'
else strip_0.effStep++;
^
sketch_dec25c:92:3: error: expected unqualified-id before 'return'
return 0x01;
^
sketch_dec25c:93:1: error: expected declaration before '}' token
}
^
exit status 1
expected unqualified-id before 'if'

Fade does not work

Fade shows the start color until the end, then for one step the end color.
in the generated code the line:
e = (strip_0.effStep * 1) / 30000;
have to cast to float
e = (float)(strip_0.effStep * 1) / 30000;
then it works

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.