Here is the code for the AS6212 with the call to the neopixel:...\Documents\Arduino\Example_01_BasicReadings_playing_around\Example_01_BasicReadings_playing_around.ino:28:3: error: 'pixels' was not declared in this scope
28 | pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
| ^~~~~~
exit status 1
Compilation error: 'pixels' was not declared in this scope
I have checked to make sure I'm using the correct port and baud rate. I have validated that both the Neopixel and AS6212 libraries are loaded in Arduino.#include <Adafruit_NeoPixel.h>
#include "SparkFun_AS6212_Qwiic.h" //Click here to get the library: http://librarymanager/All#SparkFun_AS6212
#include <Wire.h>
#define NUMPIXELS 1
AS6212 sensor;
//Initialize temperature variables as floats
float tempC;
float tempF;
void setup() {
Serial.begin(115200);
#if defined(NEOPIXEL_POWER)
// If this board has a power control pin, we must set it to output and high
// in order to enable the NeoPixels. We put this in an #if defined so it can
// be reused for other boards without compilation errors
pinMode(NEOPIXEL_POWER, OUTPUT);
digitalWrite(NEOPIXEL_POWER, HIGH);
#endif
pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
pixels.setBrightness(20); // not so bright
pixels.fill(0x00FF00);
pixels.show();
Serial.println("SparkFun AS6212 Qwiic Example 1 - Basic Readings");
Wire.begin();
}
void loop() {
tempC = sensor.readTempC();
tempF = sensor.readTempF();
Serial.println();
Serial.print("Temperature (°C): ");
Serial.print(tempC, 6); //Reads out 6 characters of the temperature float
Serial.print("\tTemperature (°F): ");
Serial.println(tempF, 6); //Reads out 6 characters of the temperature float
delay(1000);
}
What am I missing?
Thanks