Comments (11)
Actually in 2-button mode Gravity Color works as well. And yes, currently there is a place holder for fix color profiles, but it's not imlemented yet. It existed in an earlier version of LSOS though. Later I removed because Gravity Color is so much more advanced. Nevertheless I will put it back, but it's not on my prio list. I'm still thinking about how to go about it without breaking the integrity of the code.
from fx-saberos.
I changed in buttons.cpp
#ifdef GRAVITY_COLOR
ColorMixing(storage.sndProfile[storage.soundFont].mainColor,modification,MAX_BRIGHTNESS, SaturateColor);
#else if COLOR_PROFILE
#endif
to
else if (ConfigModeSubStates==CS_MAINCOLOR) {
#ifdef GRAVITY_COLOR
ColorMixing(storage.sndProfile[storage.soundFont].mainColor,modification,MAX_BRIGHTNESS, SaturateColor);
#else if COLOR_PROFILE
if (ButtonActionType==SINGLE_CLICK){
confParseValue(modification, 0, 14, incrementSign);
modification = value;
getColorFix(modification);
}
#endif
storage.sndProfile[storage.soundFont].mainColor.r=currentColor.r;
storage.sndProfile[storage.soundFont].mainColor.g=currentColor.g;
storage.sndProfile[storage.soundFont].mainColor.b=currentColor.b;
lightOn(ledPins, -1, currentColor, NUMPIXELS/2, NUMPIXELS-6);
delay(50);
}
else if (ConfigModeSubStates==CS_CLASHCOLOR) {
#ifdef GRAVITY_COLOR
ColorMixing(storage.sndProfile[storage.soundFont].clashColor,modification,MAX_BRIGHTNESS, SaturateColor);
#else if COLOR_PROFILE
if (ButtonActionType==SINGLE_CLICK){
confParseValue(modification, 0, 14, incrementSign);
modification = value;
getColorFix(modification);
}
#endif
storage.sndProfile[storage.soundFont].clashColor.r=currentColor.r;
storage.sndProfile[storage.soundFont].clashColor.g=currentColor.g;
storage.sndProfile[storage.soundFont].clashColor.b=currentColor.b;
lightOn(ledPins, -1, currentColor, 1, NUMPIXELS/2-1);
delay(50);
}
else if (ConfigModeSubStates==CS_BLASTCOLOR) {
#ifdef GRAVITY_COLOR
ColorMixing(storage.sndProfile[storage.soundFont].blasterboltColor,modification,MAX_BRIGHTNESS, SaturateColor);
#else if COLOR_PROFILE
if (ButtonActionType==SINGLE_CLICK){
confParseValue(modification, 0, 14, incrementSign);
modification = value;
getColorFix(modification);
}
#endif
storage.sndProfile[storage.soundFont].blasterboltColor.r=currentColor.r;
storage.sndProfile[storage.soundFont].blasterboltColor.g=currentColor.g;
storage.sndProfile[storage.soundFont].blasterboltColor.b=currentColor.b;
lightOn(ledPins, -1, currentColor, NUMPIXELS*3/4-5, NUMPIXELS*3/4);
delay(50);
}
and add function to change color from LSOS 1.4
#ifdef COLOR_PROFILE
void getColorFix(uint8_t colorID) {
switch (colorID) {
case 0:
//Red
currentColor.r = 200;
currentColor.g = 0;
currentColor.b = 0;
break;
case 1:
//Yellow
currentColor.r = 200;
currentColor.g = 200;
currentColor.b = 0;
break;
case 2:
//Green
currentColor.r = 0;
currentColor.g = 200;
currentColor.b = 0;
break;
case 3:
//Aqua
currentColor.r = 0;
currentColor.g = 200;
currentColor.b = 200;
break;
case 4:
//Blue
currentColor.r = 0;
currentColor.g = 0;
currentColor.b = 200;
break;
case 5:
//Fuschia
currentColor.r = 200;
currentColor.g = 0;
currentColor.b = 200;
break;
case 6:
//DarkGrey
currentColor.r = 150;
currentColor.g = 150;
currentColor.b = 150;
break;
case 7:
//DarkOrange
currentColor.r = 200;
currentColor.g = 102;
currentColor.b = 0;
break;
case 8:
//DarkViolet
currentColor.r = 116;
currentColor.g = 0;
currentColor.b = 166;
break;
case 9:
//DodgerBlue
currentColor.r = 24;
currentColor.g = 112;
currentColor.b = 200;
break;
case 10:
//Gold
currentColor.r = 200;
currentColor.g = 168;
currentColor.b = 0;
break;
case 11:
//GoldenRod
currentColor.r = 170;
currentColor.g = 130;
currentColor.b = 24;
break;
case 12:
//Indigo
currentColor.r = 116;
currentColor.g = 0;
currentColor.b = 204;
break;
case 13:
//LightGreen
currentColor.r = 112;
currentColor.g = 186;
currentColor.b = 112;
break;
default:
// White (if enough voltage)
currentColor.r = 200;
currentColor.g = 200;
currentColor.b = 200;
break;
}
} //getColorFix
#endif
from fx-saberos.
If this works, I'm happy! The reason I did not simply want to copy the LSOS code over was that this one uses a colorID to store in EEPROM, and the current FX-SaberOS use a cRGB variable, which consists of 3 bytes. Therefore they are not really compatible. I need to think about how to rewrite the code so that we can still store the same data type as with Gravity Color.
from fx-saberos.
It's no need to save ColorId.
At first time color displays from stored value cRGB - then if you want to change color, ColorId saves in local variable "modification" - i checked it used only in GravityColor to define axis, i.e. not used in Color_profile.
Colors save as cRGB - I don't changed it.
Thank you very much for the FX-SaberOS.
from fx-saberos.
If it really works like that I will consider to integrate it inside the code, thanks for trying it out! Really happy that there are still guys out there not only taking the code as granted but willing to tweak it!
from fx-saberos.
Hellow Friends,
i checked the code of "rorzo" and working fine in the previous version of fx-saberOS and in the new one,
in the past i try to tweak this feature, but my knowlege are limited jejeje
thanks for your work folks.
from fx-saberos.
I'm also having hard times trying to configure the color of the blade with Gravity Color on an RGB Star setup. Without the help given by the last pixels in the blade, I find very hard to find proper positions of the hilt to edit the configuration of the three LEDs.
Will try to test Rorzo' solution tonight, if time permits before going to sparring class.
from fx-saberos.
I found rorzo's solution so elegant (simply bringing back an old solution, integrating in seamlessly into a much later version) that I committed it now. Have fun!
from fx-saberos.
So. The only code I need to replace is Buttons.cpp?
from fx-saberos.
from fx-saberos.
Thanks! Thanks! That's what I've been waiting for! I will test it soon!
from fx-saberos.
Related Issues (20)
- Flame effects HOT 2
- button HOT 3
- NPXL pcb wiring
- No sound - Speaker without amplifier or additional power? HOT 3
- hum loop cut HOT 1
- problem with the two buttons config
- Sound problem with the Config Mode HOT 2
- problem with arduino nano and mpu HOT 2
- Problem with the MP3-TF-16P sound HOT 4
- sound problems HOT 2
- Exceeds available space on Nano with DIYINO_PRIME and PIXELBLADE HOT 2
- Df player freezes and resets HOT 9
- Button HOT 4
- Boot sound not playing HOT 8
- Possible to change mainColor to being set by RGB sensor module? HOT 4
- Issue compiling HOT 1
- Crossguard Saber HOT 2
- Lockup on clash HOT 2
- No audio, button doesn't work, LED strip lights up red HOT 3
- Hum and development HOT 10
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 fx-saberos.