I don’t think there’s any problem with the library. What would be helpful is if you could show me how to alter the sensor configuration in this code, after the sensor is successfully initialized. I don’t know that it’s actualliy necessary to change anything about the default configuration, but it seems like I should be able to use config() to do that as required.
/*ISL29125_OLED.ino
A basic test sketch is available in the Sparkfun library.
See ISL29125Test.ino for my version.
Adds IZOKEE 0.96" I2C OLED display for output.
*/
#include <Wire.h>
#include “SparkFunISL29125.h”
SFE_ISL29125 RGB_sensor;
#include “U8x8lib.h”
U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(U8X8_PIN_NONE);
unsigned int red,green,blue,total;
float Fred,Fgreen,Fblue;
const long int DelayTime=2000L;
void setup(){
Serial.begin(9600); u8x8.begin();
u8x8.setFont(u8x8_font_chroma48medium8_r);
if (RGB_sensor.init()) {
Serial.println(“Sensor Initialization Successful\n\r”);
}
}
void loop() {
red=RGB_sensor.readRed(); green=RGB_sensor.readGreen();
blue=RGB_sensor.readBlue(); total=red+blue+green;
Fred=(float)red/total; Fgreen=(float)green/total;
Fblue=(float)blue/total;
Serial.print("Red: "); Serial.println(red);
Serial.print("Green: "); Serial.println(green);
Serial.print("Blue: "); Serial.println(blue);
Serial.print("Fred: "); Serial.println(Fred,4);
Serial.print("Fgreen: "); Serial.println(Fgreen,4);
Serial.print("Fblue: "); Serial.println(Fblue,4);
u8x8.setCursor(0,1);
u8x8.print(" Red: "); u8x8.println(red);
u8x8.print("Green: "); u8x8.println(green);
u8x8.print(" Blue: "); u8x8.println(blue);
u8x8.print(" Fred: "); u8x8.println(Fred,4);
u8x8.print("Fgreen: "); u8x8.println(Fgreen,4);
u8x8.print(" Fblue: "); u8x8.println(Fblue,4);
delay(DelayTime);
u8x8.clearDisplay();
}