These are chat archives for Makuna/NeoPixelBus

5th
Jun 2016
sticilface
@sticilface
Jun 05 2016 19:45
@makuna... i've just taken some delivery of some rgbw pixels...
I've changed my pixels definition to typedef NeoPixelBus<NeoGrbwFeature, Neo800KbpsMethod> MyPixelBus;
sticilface
@sticilface
Jun 05 2016 19:52
but now i get
This message was deleted
/Users/amelvin/Dropbox/Sketchbook/Melvanimate-ASYNC-withESPManager/Melvanimate-ASYNC-withESPManager.ino: In function 'void offFn(effectState&, EffectHandler*)':
Melvanimate-ASYNC-withESPManager:241: error: conversion from 'Neo4Elements::ColorObject {aka RgbwColor}' to non-scalar type 'RgbColor' requested
           RgbColor originalColor = strip->GetPixelColor(pixel);
                                                              ^
/Users/amelvin/Dropbox/Sketchbook/Melvanimate-ASYNC-withESPManager/Melvanimate-ASYNC-withESPManager.ino: In function 'void SimpleColorFn(effectState&, EffectHandler*)':
Melvanimate-ASYNC-withESPManager:305: error: conversion from 'Neo4Elements::ColorObject {aka RgbwColor}' to non-scalar type 'RgbColor' requested
           RgbColor originalColor = strip->GetPixelColor(pixel);
sticilface
@sticilface
Jun 05 2016 19:59
the offending line is
          RgbColor originalColor = strip->GetPixelColor(pixel);
i tried creating an initialisation for RgbW for RgbColor but doesn't seem to fix it... and clues
i'd just like Rgbw to Rgb to leave out the W... in the same way that Rgb to Rgbw leaves it out
Michael Miller
@Makuna
Jun 05 2016 20:04
I believe this covered in the wiki, arbitrarily leaving out W is loss of data and should not be automatic, Rgb to Rgbw there is no loss so it is automatic.
It could be in a better place though.
sticilface
@sticilface
Jun 05 2016 20:16
i did miss that...
what do i need to put for the getpixelcolor though?
Michael Miller
@Makuna
Jun 05 2016 20:17
Assign it to a RgbwColor and then convert by creating a RgbwColor with the .r,.g..b, the last example from the link above had the way
I hate the android app for gitter, I can't edit and sometimes it seems to autocorrect when I don't want to, that last RgbwColor should be RgbwColor
It did it again! That last RgbwColor should only be Rgb
sticilface
@sticilface
Jun 05 2016 20:20
could there be an 'easier way'... as i've got a massive sketch.. with tonnes of get pixels...
Michael Miller
@Makuna
Jun 05 2016 20:20
Just use RgbwColor
sticilface
@sticilface
Jun 05 2016 20:20
i was kinda hoping just to change the implementation in typedef... and have it work with rgbws....
by default
ok...
Michael Miller
@Makuna
Jun 05 2016 20:22
Create two inline functions named the same, one take Rgbw and returns Rgb, the other takes Rgb and returns Rgb and does nothing. Then wrap all calls to Get pixel color with the inline.
sticilface
@sticilface
Jun 05 2016 20:24
ooo very clever:)
sticilface
@sticilface
Jun 05 2016 21:16
that worked great... they're pretty cool LEDs... useable white now without blowing the power requirements!
cheers