Updated FAQ #11 (markdown)

Michael Miller
2017-07-27 19:50:50 -07:00
parent fa4ff10a6b
commit ac8375f37f

@@ -46,22 +46,21 @@ 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 class using a reference; requires all code to be in the include
template<typename T_PIXEL_METHOD> class PixelRef { class PixelRef {
public: public:
PixelRef(T_PIXEL_METHOD& pixelStrip) : PixelRef(NeoPixelBusType& pixelStrip) :
_strip(pixelStrip) { _strip(pixelStrip) {
} }
void Draw() { void Draw() {
_strip.Show(); _strip.Show();
} }
private: private:
T_PIXEL_METHOD& _strip; NeoPixelBusType& _strip;
}; };
PixelRef myPixelRef(strip);
PixelRef<NeoPixelBusType> myPixelRef(strip);
void setup() { void setup() {
strip.Begin(); strip.Begin();