Ah great I will try that. This is the code I was using with the updated libraries and it seemed to give me values just unsure what of
#include "Si115X.h"
Si115X si1151;
/**
* Setup for configuration
*/
void setup()
{
Wire.begin();
Serial.begin(115200);
if (!si1151.Begin()) {
Serial.println("Si1151 is not ready!");
while (1) {
delay(1000);
Serial.print(".");
};
}
else {
Serial.println("Si1151 is ready!");
}
}
/**
* Loops and reads data from registers
*/
void loop()
{
Serial.print("IR: ");
Serial.println(si1151.ReadIR());
Serial.print("Visible: ");
Serial.println(si1151.ReadVisible());
delay(500);
}
I also found for some odd reason, maybe since I am using the XIAO ESP32S3 with the XIAO Expansion board I needed to initalise the OLED display for it to work so I have also attached that code:
#include "Si115X.h"
#include <U8x8lib.h> // Include U8x8 library for OLED display
Si115X si1151;
U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/*reset=*/U8X8_PIN_NONE); // Create an instance of OLED display
void setup()
{
u8x8.begin();
Wire.begin();
Serial.begin(115200);
if (!si1151.Begin()) {
Serial.println("Si1151 is not ready!");
while (1) {
delay(1000);
Serial.print(".");
};
}
else {
Serial.println("Si1151 is ready!");
}
}
/**
* Loops and reads data from registers
*/
void loop()
{
Serial.print("IR: ");
Serial.println(si1151.ReadIR());
Serial.print("Visible: ");
Serial.println(si1151.ReadVisible());
delay(500);
}