Hi, I recently obtained a HuskyLens Machine Vision Sensor and am having trouble with the included library. I checked the DFRobot forum for my problem and it does exist, but the replies to those forum posts were less than useless, simply saying to try a block based coding website called mind+.
My problem is that whenever I try to verify a sketch with the huskylens library I get the following error.
In file included from C:\Users\Seth\Documents\Arduino\HuskyLens_basic\HuskyLens_basic.ino:1:0:
C:\Users\Seth\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h: In member function 'bool HUSKYLENS::writeFirmwareVersion(String)':
C:\Users\Seth\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h:706:43: error: variable-sized object 'data' may not be initialized
uint8_t data[length + 2] = {length};
This happens with the included examples and with a blank sketch with just #include "HUSKYLENS" and an empty setup and loop function.
If anyone has any insight on how to work with this library that seems kinda half finished your help would be greatly appreciated.
I am not experience in library editing but it does appear that the ide thinks there is some sort of un initalized variable or bad syntax. If anyone could tell me if there is something obvious here it would be appreciated.
Here is a link to the GitHub page for the library to the header file in question.
Here is the whole error thrown by the ide.
In file included from C:\Users\Seth\Documents\Arduino\libraries\HUSKYLENS\examples\HUSKYLENS_I2C\HUSKYLENS_I2C.ino:22:0:
C:\Users\Seth\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h: In member function 'bool HUSKYLENS::writeFirmwareVersion(String)':
C:\Users\Seth\Documents\Arduino\libraries\HUSKYLENS/HUSKYLENS.h:706:43: error: variable-sized object 'data' may not be initialized
uint8_t data[length + 2] = {length};
^
exit status 1
Error compiling for board Arduino Due (Programming Port).
Thanks alot, i've still got some issues from other portions of the library, but it can compile now and thats a game changer. Would you mind if I push this to the github? The latter suggestion is what worked.