Hi guys im trying to code my NeoPixel Ring 44mm 16 LED WS2812 light to fade in and out of 2 colours, For the example we will say Red and Green as these can easily be changed. However using the code from the a site gave me the below.
This issue im having is it states both the direction has not been declared and the ActivePattern = FADE has not been declared in the scope. The error for the direction shas been added below the code.
#include <Adafruit_NeoPixel.h>
#define LED_PIN 4
#define LED_COUNT 16
#define BRIGHTNESS 200
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_RGB + NEO_KHZ800);
uint32_t color1 = strip.Color(255, 0 , 0);
uint32_t color2 = strip.Color(0, 0, 255);
uint16_t steps = 16;
uint8_t interval = 100;
void setup() {
strip.begin();
strip.show();
strip.setBrightness(50);
}
void loop() {
void Fade(uint32_t color1, uint32_t color2, uint16_t steps, uint8_t interval, direction dir = FORWARD)
{
ActivePattern = FADE;
Interval = interval;
TotalSteps = steps;
Color1 = color1;
Color2 = color2;
Index = 0;
Direction = dir;
}
}
}
Arduino: 1.8.16 (Windows Store 1.8.51.0) (Windows 10), Board: "Arduino Uno"
C:\Users\joshi\OneDrive\Documents\Arduino\fail\fail.ino: In function 'void loop()':
fail:26:81: error: 'direction' has not been declared
void Fade(uint32_t color1, uint32_t color2, uint16_t steps, uint8_t interval, direction dir = FORWARD)
^~~~~~~~~
fail:26:97: error: 'FORWARD' was not declared in this scope
void Fade(uint32_t color1, uint32_t color2, uint16_t steps, uint8_t interval, direction dir = FORWARD)
^~~~~~~
fail:27:3: error: a function-definition is not allowed here before '{' token
{
^
C:\Users\joshi\OneDrive\Documents\Arduino\fail\fail.ino: At global scope:
fail:37:1: error: expected declaration before '}' token
}
^
exit status 1
'direction' has not been declared
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.