Comments (3)
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.
I just tried it; it only turned on one LED. I also tried i+2 and it only turned on one.
from lightsaberos.
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)
- error compiling star-led 1.5 HOT 2
- crazy , neopixel led blade. HOT 1
- compile error TCCr2a was not declared in this scope HOT 6
- SoundGap before a swing HOT 2
- How can disable the grativy function HOT 4
- Jukebox Playing on Launch HOT 5
- After switching off light saber it won't power on anymore with main switch only complete reset HOT 4
- Blaster blocage ! HOT 4
- Erreur compilation Arduino/ Uno HOT 7
- 12Neopixel and
- Lsos 1.5 gravity and more than 120pixels HOT 5
- DFPlayer Behavior on LSOS 1.5 HOT 4
- Single button mode is not behaving correctly HOT 3
- sound font problem? HOT 6
- battery HOT 5
- Cant get the HUM Sound file to work.
- Max brightness and D8-D11 HOT 4
- Newbie for lightsaber
- Why is the code so long. HOT 1
- Hum sound always on HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightsaberos.