Updated FAQ #11 (markdown)

Michael Miller
2017-07-26 12:07:54 -07:00
parent 0257aaae17
commit 95bde8ea35

@@ -1,4 +1,4 @@
### How do store a reference to the NeoPixelBus in another class? ### How do I store a reference to the NeoPixelBus in another class?
Since the NeoPixelBus is a template class; you can't just store a reference to it using older models. But there are two ways to accomplish this. Since the NeoPixelBus is a template class; you can't just store a reference to it using older models. But there are two ways to accomplish this.
@@ -10,13 +10,11 @@ typedef NeoPixelBus<NeoGrbFeature, Neo800KbpsMethod> NeoPixelBusType;
NeoPixelBusType strip(4, 2); NeoPixelBusType strip(4, 2);
// example class using a reference; requires all code to be in the include // example template class using a reference; requires all code to be in the include
template<typename T_PIXEL_METHOD> class PixelRef template<typename T_PIXEL_METHOD> class PixelRef {
{
public: public:
PixelRef(T_PIXEL_METHOD& pixelStrip) : PixelRef(T_PIXEL_METHOD& pixelStrip) :
_strip(pixelStrip) { _strip(pixelStrip) {
} }
void Draw() { void Draw() {