Giter Club home page Giter Club logo

Comments (11)

Protonerd avatar Protonerd commented on August 19, 2024

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.

rorzo avatar rorzo commented on August 19, 2024

Buttons.zip

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.

Protonerd avatar Protonerd commented on August 19, 2024

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.

rorzo avatar rorzo commented on August 19, 2024

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.

Protonerd avatar Protonerd commented on August 19, 2024

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.

Snyperdead avatar Snyperdead commented on August 19, 2024

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.

DonSaber avatar DonSaber commented on August 19, 2024

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.

Protonerd avatar Protonerd commented on August 19, 2024

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.

MattLeshman avatar MattLeshman commented on August 19, 2024

So. The only code I need to replace is Buttons.cpp?

from fx-saberos.

jbkuma avatar jbkuma commented on August 19, 2024

from fx-saberos.

MattLeshman avatar MattLeshman commented on August 19, 2024

Thanks! Thanks! That's what I've been waiting for! I will test it soon!

from fx-saberos.

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.