These are chat archives for Makuna/NeoPixelBus

21st
Jul 2017
Jeff Bergman
@Izrun
Jul 21 2017 04:29
Looks like I can't really template the class I was going to use. I'm actually attempting to integrate it into a library and I would have to make extensive changes to make this work. I realized that the class I'm making is actually used/stored in other objects so those would have the same issue. I'd have to make THAT one a template too, etc. Basically turtles all the way down :). Anyway, do you happen to remember how to define a type for the NeoPixelBus and pass it as a single template argument? I looked through all the examples and didn't see when this was done. The closest I found was in NeoPixelBufferCylon.ino which had typedef NeoGrbFeature MyPixelColorFeature; However, I don't see how that would help because I can't pass it as an argument. My next step is to "de-template" your class, which I'm hoping to avoid. Thanks!
Michael Miller
@Makuna
Jul 21 2017 04:31
typedef myNeoPixelClass NeoPixelBus<theRgbfeature, theMethod>
Then just use myneoPixelClass as the type
Jeff Bergman
@Izrun
Jul 21 2017 04:39
Hmm. My issue where to put that then. I would think it would need to be in the library's header file, but then I'd run into the same issue where I would have to hard code
the feature/method/size in the class. If I put it in the .ino file and used it to create the object to pass to the class, that's all fine, but I would still have to declare it in my library header file and I can't call it myNeoPixelClass there. Also, i I add that typedef to my .ino file and try to compile (without actually referring to myNeoPixelClass anywhere, just to make sure it compiled with that there) is says 'myNeoPixelClass' does not name a type
Michael Miller
@Makuna
Jul 21 2017 04:40
If your library is all in a header (no c or cpp) then just make sure in the INO you define it before including the library header file. That's the best you will be able to do.
Jeff Bergman
@Izrun
Jul 21 2017 04:50
That didn't seem to help. Thanks for taking the time to try though. It's so nice of you to offer your time. I'm going to have to mess around some more and see if I can figure something out. I'll look into the typedef stuff more. I'm attempting to make a neopixel script controller for smartthings using the ST_Anything library, which is pretty complex in itself as far as these things go. I was able to make it work with the Adafruit library but was getting wtd resets because of bitbang. You library works so much better and seems to work for me if I hard code in the files. That would work for me but I want to share it back to the community so I'm trying to generalize. I'm sure I'll figure it out eventually. Thanks again for your help.