Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using DEFINE_GRADIENT_PALETTE And Serial.print breaks app #780

Open
tripdragon opened this issue Apr 26, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@tripdragon
Copy link

commented Apr 26, 2019

Specs:

  • Board: ESP8266
  • FastLED 3.2.6
  • Ardunio IDE 1.8.9 OSX

If I define a Palette from the define Macro and contain a Serial.print println or write in the loop and CRGBPalette16 name = othername is present the app will not work.

I might have some lack of understanding of the combos.

It also seems to not work with Serial.read()

Example code below.

//#define FASTLED_INTERRUPT_RETY_COUNT 0
#include <FastLED.h>

//CRGBArray<NUM_LEDS> leds;
CRGB leds[NUM_LEDS];

DEFINE_GRADIENT_PALETTE(_seaColors_p){
  0, 0, 255, 0,
  100, 254, 214, 52,
  140, 155, 164, 223,
  255, 78, 94, 198
};
CRGBPalette16 _seaColorsZ = _seaColors_p;



void setup() {
  delay( 3000 ); // power-up safety delay
  FastLED.addLeds<WS2811, 8, RGB>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
  FastLED.setBrightness(  200 );
  
  Serial.begin(9600);

}



void loop() {

//  Serial.println(" works 1 ?");
Serial.print(" works 2 ?");
//Serial.write(" works 3 ?");
  // Serial.read();

  for( int i = 0; i < NUM_LEDS; i++) {
    leds[i] = CRGB::Blue;
    // leds[i] = ColorFromPalette( _seaColorsZ, 0);
  }

  delay(1);
  FastLED.show();

}
@focalintent

This comment has been minimized.

Copy link
Member

commented Apr 27, 2019

When you say it doesn't work - what do you mean isn't working - what happens when you run it (and equally - what are you expecting that isn't happening?) -- also, as a quick aside, make sure that you're using the right baud rate for the serial port (the number in Serial.begin() should match the number in the drop down in Arduino's serial number)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.