mirror of
https://github.com/Makuna/NeoPixelBus.git
synced 2025-08-09 22:04:27 +02:00
Updated FAQ #11 (markdown)
13
FAQ-#11.md
13
FAQ-#11.md
@@ -46,22 +46,21 @@ typedef NeoPixelBus<NeoGrbFeature, Neo800KbpsMethod> NeoPixelBusType;
|
||||
NeoPixelBusType strip(4, 2);
|
||||
|
||||
// example class using a reference; requires all code to be in the include
|
||||
template<typename T_PIXEL_METHOD> class PixelRef {
|
||||
class PixelRef {
|
||||
public:
|
||||
PixelRef(T_PIXEL_METHOD& pixelStrip) :
|
||||
_strip(pixelStrip) {
|
||||
PixelRef(NeoPixelBusType& pixelStrip) :
|
||||
_strip(pixelStrip) {
|
||||
}
|
||||
|
||||
void Draw() {
|
||||
void Draw() {
|
||||
_strip.Show();
|
||||
}
|
||||
|
||||
private:
|
||||
T_PIXEL_METHOD& _strip;
|
||||
NeoPixelBusType& _strip;
|
||||
};
|
||||
|
||||
|
||||
PixelRef<NeoPixelBusType> myPixelRef(strip);
|
||||
PixelRef myPixelRef(strip);
|
||||
|
||||
void setup() {
|
||||
strip.Begin();
|
||||
|
Reference in New Issue
Block a user