Coder Social home page Coder Social logo

Comments (3)

Protonerd avatar Protonerd commented on September 14, 2024

In line 948 of Light.cpp, you see this:
for (uint8_t i=0; i<NUMPIXELS; i++) { // turn on/off one LED at a time

If you want to make the ignition faster, the only way is to switch on/off multiple leds at a time, like this (5 pixels per cycle):
for (uint8_t i=0; i<NUMPIXELS; (i=i+5)) { // turn on/off one LED at a time

from lightsaberos.

Sligs78 avatar Sligs78 commented on September 14, 2024

I just tried it; it only turned on one LED. I also tried i+2 and it only turned on one.

from lightsaberos.

jbkuma avatar jbkuma commented on September 14, 2024

You can try this code to replace the RampNeoPixel function

void RampNeoPixel(uint16_t RampDuration, bool DirectionUpDown) {
unsigned long ignitionStart = millis();
cRGB value;
#ifdef FIREBLADE
for (unsigned int i=0; i<NUMPIXELS; (i=i+5)) { // turn on/off one LED at a time
FireBlade();
for(unsigned int j=0; j<NUMPIXELS; j++ ) { // fill up string with data
if ((DirectionUpDown and j<=i) or (!DirectionUpDown and j<=NUMPIXELS-1-i)){
}
else if ((DirectionUpDown and j>i) or (!DirectionUpDown and j>NUMPIXELS-1-i)){
value.r=0;
value.g=0;
value.b=0;
//heat[j]=0;
pixels.set_crgb_at(j, value); // Set value at LED found at index j
}
}
pixels.sync(); // Sends the data to the LEDs
}
#else
for (unsigned int i = 0; i < NUMPIXELS; i = NUMPIXELS*(millis()-ignitionStart)/RampDuration) { // turn on/off one LED at a time
for(uint8_t j=0; j<NUMPIXELS; j++ ) { // fill up string with data
if ((DirectionUpDown and j<=i) or (!DirectionUpDown and j<=NUMPIXELS-1-i)){
value.r = MAX_BRIGHTNESS * currentColor.r / rgbFactor;
value.g = MAX_BRIGHTNESS * currentColor.g / rgbFactor;
value.b = MAX_BRIGHTNESS * currentColor.b / rgbFactor;
}
else if ((DirectionUpDown and j>i) or (!DirectionUpDown and j>NUMPIXELS-1-i)){
value.r=0;
value.g=0;
value.b=0;
}
pixels.set_crgb_at(j, value);
}
pixels.sync(); // Sends the data to the LEDs
delay(RampDuration/NUMPIXELS);
}
#endif
}

from lightsaberos.

Related Issues (20)

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.