So I have connected a SparkFun Triad Spectroscopy Sensor - AS7265x (Qwiic) to my SparkFun Thing Plus - ESP32-S2 WROOM using a Qwiic cable. I loaded the example code and I am only getting zeros from the sensors… No error, it throws a connection error when disconnected, just this image as the output over the serial monitor. https://imgur.com/a/OpC5hij
/*
Read the 18 channels of spectral light over I2C using the Spectral Triad
By: Nathan Seidle
SparkFun Electronics
Date: October 25th, 2018
License: MIT. See license file for more information but you can
basically do whatever you want with this code.
This example takes all 18 readings and blinks the illumination LEDs
as it goes. We recommend you point the Triad away from your eyes, the LEDs are *bright*.
Feel like supporting open source hardware?
Buy a board from SparkFun! https://www.sparkfun.com/products/15050
Hardware Connections:
Plug a Qwiic cable into the Spectral Triad and a BlackBoard
If you don't have a platform with a Qwiic connection use the SparkFun Qwiic Breadboard Jumper (https://www.sparkfun.com/products/14425)
Open the serial monitor at 115200 baud to see the output
*/
#include "SparkFun_AS7265X.h" //Click here to get the library: http://librarymanager/All#SparkFun_AS7265X
AS7265X sensor;
#include <Wire.h>
void setup()
{
Serial.begin(115200);
Serial.println("AS7265x Spectral Triad Example");
Serial.println("Point the Triad away and press a key to begin with illumination...");
while (Serial.available() == false)
{
} //Do nothing while we wait for user to press a key
Serial.read(); //Throw away the user's button
if (sensor.begin() == false)
{
Serial.println("Sensor does not appear to be connected. Please check wiring. Freezing...");
while (1)
;
}
sensor.disableIndicator(); //Turn off the blue status LED
Serial.println("A,B,C,D,E,F,G,H,R,I,S,J,T,U,V,W,K,L");
}
void loop()
{
sensor.takeMeasurementsWithBulb(); //This is a hard wait while all 18 channels are measured
Serial.print(sensor.getCalibratedA()); //410nm
Serial.print(",");
Serial.print(sensor.getCalibratedB()); //435nm
Serial.print(",");
Serial.print(sensor.getCalibratedC()); //460nm
Serial.print(",");
Serial.print(sensor.getCalibratedD()); //485nm
Serial.print(",");
Serial.print(sensor.getCalibratedE()); //510nm
Serial.print(",");
Serial.print(sensor.getCalibratedF()); //535nm
Serial.print(",");
Serial.print(sensor.getCalibratedG()); //560nm
Serial.print(",");
Serial.print(sensor.getCalibratedH()); //585nm
Serial.print(",");
Serial.print(sensor.getCalibratedR()); //610nm
Serial.print(",");
Serial.print(sensor.getCalibratedI()); //645nm
Serial.print(",");
Serial.print(sensor.getCalibratedS()); //680nm
Serial.print(",");
Serial.print(sensor.getCalibratedJ()); //705nm
Serial.print(",");
Serial.print(sensor.getCalibratedT()); //730nm
Serial.print(",");
Serial.print(sensor.getCalibratedU()); //760nm
Serial.print(",");
Serial.print(sensor.getCalibratedV()); //810nm
Serial.print(",");
Serial.print(sensor.getCalibratedW()); //860nm
Serial.print(",");
Serial.print(sensor.getCalibratedK()); //900nm
Serial.print(",");
Serial.print(sensor.getCalibratedL()); //940nm
Serial.print(",");
Serial.println();
}