I want to create a void function that takes an object as an argument other than an int, double, float, etc. Specifically, I am trying to take a previously defined Adafruit_Neopixel object. When I run this test code, it executes the function once, then does not loop it. It's as if the function redefines or renames the Adafruit_Neopixel object, such that it cannot execute again during void loop().
#include <Adafruit_NeoPixel.h>
#define MAX_BRIGHTNESS 250 // (max = 255)
#define LED_COUNT 36
Adafruit_NeoPixel lowstrip(LED_COUNT, 6, NEO_GRB + NEO_KHZ800);
void setup() {
lowstrip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
lowstrip.show(); // Turn OFF all pixels ASAP
lowstrip.setBrightness(MAX_BRIGHTNESS);
}
void loop() {
stripper(lowstrip);
lowstrip.clear();
}
void stripper (Adafruit_NeoPixel strip) {
for (int i = 0; i < LED_COUNT; i++) {
strip.setPixelColor(i, strip.Color(20, 30, 40));
strip.show();
delay(40);
}
}