These are chat archives for Makuna/NeoPixelBus

8th
Jul 2015
probonopd
@probonopd
Jul 08 2015 06:11
@sticilface regarding the button staying off, that is actually very easy to fix. Right now I am sending static json but once I keep track of the state of each light and send according json, this will be fixed
probonopd
@probonopd
Jul 08 2015 06:28
thanks @sticilface changed the -> calls. Animations are not smooth though
sticilface
@sticilface
Jul 08 2015 07:48
Post ur new version and I'll see what it does on my end.
sticilface
@sticilface
Jul 08 2015 12:52

@probonopd figured it out. In the animate callback the blends are now floats as well, not an uint8_t you need to change your animation from

        HslColor updatedColor = HslColor::LinearBlend(originalColor, black, (uint8_t)(255 * progress));

to this

        HslColor updatedColor = HslColor::LinearBlend(originalColor, black, progress);
works nicely for me now
sticilface
@sticilface
Jul 08 2015 14:31
there is another bug too..
in each animate bit you call setpixelcolor twice... this is what it should look like
 if (onValue == true)
    {
      AnimUpdateCallback animUpdate = [ = ](float progress)
      {
        // progress will start at 0.0 and end at 1.0
        HslColor updatedColor = HslColor::LinearBlend(originalColor, white, progress);
        strip.SetPixelColor(numberOfTheLight, updatedColor);
      };
      //strip.SetPixelColor(numberOfTheLight, white); //THIS IS NOT NEEDED
      animator.StartAnimation(numberOfTheLight, transitionTime, animUpdate);
    }
i've spent a bit of time going through some stuff. your infolight code does not work.
sticilface
@sticilface
Jul 08 2015 14:42

this is what you have.. you are calling show after each LED update.. when it should be at the end.

void infoLight(RgbColor color) {
  // Flash the strip in the selected color. White = booted, green = WLAN connected, red = WLAN could not connect
  for (int i = 0; i < pixelCount; i++)
  {
    strip.SetPixelColor(i, color);
    strip.Show();
    delay(10);
    strip.SetPixelColor(i, black);
    strip.Show();
  }
}

and this is what it should be

void infoLight(RgbColor color) {
  for (int i = 0; i < pixelCount; i++)
  {
    strip.SetPixelColor(i, color);
  }
 strip.Show();
delay(10) ; //  I would make this longer...
for (int i = 0; i < pixelCount; i++)
  {
    strip.SetPixelColor(i, 0);
  }
 strip.Show();
}

you could also use the strip.ClearTo(RgbColor(0,255,0)); command which does the same...

Having said all this though... i can't seem to get the strip to show anything apart from white, for this I have just spent the last 2hrs wondering what the hell is going on.

@Makuna There seems to be an issue with firing the LEDs during the setup function. It was annoying me that this infolight function didn't work.... like at all... even with my fix it should have worked...

check this gist out.... https://gist.github.com/abdbf7204af7eac934e4.git

basically the LEDs don't work in setup, but do in the loop.... is this normal? should be documented... i guess if it is not a bug

sticilface
@sticilface
Jul 08 2015 14:48
@Makuna another issue, i've spent the last couple of weeks trying to figure out why one of my effects causes a wdt after a given period of time. I've not got to the bottom of it. I put tracers in all over the code loop an it wdt resets at random places in the loop... , after random times, my thought is heap corruption... this function creates a LOT of animate callbacks... over time... but i've still got 12K of heap left... what are your thoughts?
sticilface
@sticilface
Jul 08 2015 15:03
for what ever reason it just decided to give me a stack.. which it doesn't normally.
2508: act= 9, unfin= 0, Coord=  0, 47 =>  47, 48, 49, 50, 51, 52, 53, 54, EndCyc=109057, Heap=12496 (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
Exception (28):
epc1=0x40103b7f epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000024 depc=0x00000000

ctx: cont 
sp: 3ffec640 end: 3ffec960 offset: 01a0

>>>stack>>>
3ffec7e0:  00040000 00000030 53002200 ffffffff  
3ffec7f0:  4000050c 3fffc278 401054b0 3fffc200  
3ffec800:  00000022 00000014 00000000 000927c0  
3ffec810:  4020bddd 00000030 0000001e ffffffff  
3ffec820:  4020bdd8 00000020 3fff7798 00000004  
3ffec830:  97ad1a8b 00000000 00000000 60000308  
3ffec840:  00000080 00000040 000000c7 3fff7580  
3ffec850:  3ffeb8a0 3ffeb348 3ffec98c 00000030  
3ffec860:  0000000a 00000002 3ffeb308 4020305c  
3ffec870:  40101a9a 00000000 00000000 00000073  
3ffec880:  00735d00 40101bdb 3ffec8c0 402056fc  
3ffec890:  3ffeaa68 000007d0 3ffec8c0 3f800000  
3ffec8a0:  3f800000 00000000 3fff8f10 40202c98  
3ffec8b0:  4020c39c 3fff82a8 3ffeaa50 4020811c  
3ffec8c0:  3fff6510 00000000 00000000 4020284f  
3ffec8d0:  00000064 0000008b 3fff82a8 4020baa9  
3ffec8e0:  0000000b 00000000 3fff77a8 4020bcd8  
3ffec8f0:  000261e8 43f80000 3fff820c 40206c24  
3ffec900:  3fffdc20 3ffeb348 3ffeb8a0 3fff7580  
3ffec910:  3ffeb348 3ffeb550 3ffeb308 40211dae  
3ffec920:  00000000 3fff90f8 3ffeb308 3ffec98c  
3ffec930:  3fffdc20 00000000 3ffeb308 40205643  
3ffec940:  3fffdc20 00000000 3ffec984 402018a2  
3ffec950:  00000000 00000000 3ffeb940 4010046c
probonopd
@probonopd
Jul 08 2015 17:12
@sticilface Thanks for your detailed review! So far I haven't implemented setting the color at all, so right now all you can do is switch 3 pixels on/off in white. But of course color will come next ;-)
sticilface
@sticilface
Jul 08 2015 17:26
no worries. Also you can get rid of the SSDP files and the SSDP.update(); in the loop as the version that is now included with the arduino IDE, works differently, and does not require it.
It would be quite nice to get all this working, I think you've made good progress! :)
probonopd
@probonopd
Jul 08 2015 18:07
@sticilface I don't understand the issue with the infolights - they should blink every pixel after the previous one in sequencein order to generate a flashing animation running from the left hand side to the right hand side of the strip (it works as intended for me)
well almost. immeditately after booting the first 10 or so pixels are not animating smoothly but I can live with it
sticilface
@sticilface
Jul 08 2015 18:12
ah.. i didn't get that you wanted to animate the sequence.... my bad, sorry. For me all I get with any effects that I put in the setup part of the sketch is white... nothing works... the gist that i posted replicates that. Are you using the latest IDE built from source? it is possible this is a new bug, if the gist i posted works for you.
probonopd
@probonopd
Jul 08 2015 18:16
With your sketch I do get blue and then green blinks of the first 7 pixels but not the animation. I am using the arduino.cc IDE with the ESP stuff from the staging Boards Manager file
sticilface
@sticilface
Jul 08 2015 18:51
right that is a bit weird. I'll re-download everything and start again. something might have gone wrong somewhere.
I don't get the blue blinking! just white, then the green...