I follow all the software instructions (install Arduino, library and follow the examples) and contact the vendor service but I still with the same error (see image below).
Do you think it is a code error, incompatible parts, or a problem with the sensor?
include <Debug.h>
#include "DEV_Config.h"
#include "Waveshare_AS7341.h"
void setup() {
DEV_ModuleInit();
Serial.print("IIC ready! Now start initializing AS7341!\r\n");
AS7341_Init(eSpm);
AS7341_ATIME_config(100);
AS7341_ASTEP_config(999);
AS7341_AGAIN_config(6);
//AS7341_EnableLED(true);// LED ON or OFF
}
void loop() {
sModeOneData_t data1;
sModeTwoData_t data2;
AS7341_startMeasure(eF1F4ClearNIR);
data1 = AS7341_ReadSpectralDataOne();
Serial.print("channel1(405-425nm):");
Serial.println(data1.channel1);
Serial.print("channel2(435-455nm):");
Serial.println(data1.channel2);
Serial.print("channel3(470-490nm):");
Serial.println(data1.channel3);
Serial.print("channel4(505-525nm):");
Serial.println(data1.channel4);
AS7341_startMeasure(eF5F8ClearNIR);
data2 =AS7341_ReadSpectralDataTwo();
Serial.print("channel5(545-565nm):");
Serial.println(data2.channel5);
Serial.print("channel6(580-600nm):");
Serial.println(data2.channel6);
Serial.print("channel7(620-640nm):");
Serial.println(data2.channel7);
Serial.print("channel8(670-690nm):");
Serial.println(data2.channel8);
Serial.print("Clear:");
Serial.println(data2.CLEAR);
Serial.print("NIR:");
Serial.println(data2.NIR);
Serial.print("--------------------------\r\n");
DEV_Delay_ms(500);
//AS7341_ControlLed(10);//Adjust the brightness of the LED lamp
}
And the error is:
"
C:\Program Files (x86)\Arduino\libraries\Waveshare_AS7341\src\DEV_Config.cpp: In function 'int I2C_Read_Byte(uint8_t)':
C:\Program Files (x86)\Arduino\libraries\Waveshare_AS7341\src\DEV_Config.cpp:104:33: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
Wire.requestFrom(I2C_ADDR, 1);
^
In file included from C:\Program Files (x86)\Arduino\libraries\Waveshare_AS7341\src\DEV_Config.h:11:0,
from C:\Program Files (x86)\Arduino\libraries\Waveshare_AS7341\src\DEV_Config.cpp:12:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:68:13: note: candidate 1: uint8_t TwoWire::requestFrom(int, int)
uint8_t requestFrom(int, int);
^~~~~~~~~~~
C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:65:13: note: candidate 2: uint8_t TwoWire::requestFrom(uint8_t, uint8_t)
uint8_t requestFrom(uint8_t, uint8_t);
^~~~~~~~~~~
C:\Program Files (x86)\Arduino\libraries\Waveshare_AS7341\src\DEV_Config.cpp: In function 'int I2C_Read_Word(uint8_t)':
C:\Program Files (x86)\Arduino\libraries\Waveshare_AS7341\src\DEV_Config.cpp:120:33: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
Wire.requestFrom(I2C_ADDR, 2);
^
In file included from C:\Program Files (x86)\Arduino\libraries\Waveshare_AS7341\src\DEV_Config.h:11:0,
from C:\Program Files (x86)\Arduino\libraries\Waveshare_AS7341\src\DEV_Config.cpp:12:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:68:13: note: candidate 1: uint8_t TwoWire::requestFrom(int, int)
uint8_t requestFrom(int, int);
^~~~~~~~~~~
C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src/Wire.h:65:13: note: candidate 2: uint8_t TwoWire::requestFrom(uint8_t, uint8_t)
uint8_t requestFrom(uint8_t, uint8_t);
^~~~~~~~~~~
"