I'm trying to connect to my HuskyLens2 to my Arduino uno r4 wifi. Since the arduino is female and only accepts male and the HuskyLens is the same, I using a male-to-male cable as an adapter to connect them two.
Here is my I2C scan script:
#include <Wire.h>
void setup() {
Wire.begin();
Serial.begin(115200);
Serial.println("Scanning...");
}
void loop() {
byte error;
Wire.beginTransmission(0x50);
error = Wire.endTransmission();
if (error == 0)
Serial.println("HuskyLens found at 0x50");
else
Serial.println("HuskyLens NOT found at 0x50");
delay(1000);
}
It prints "HuskyLens found at 0x50" so I know it connects (Unless it should connect to 0x32, but im guessing that 0x50 is 0x32 in decimal form)
However when I run the following I get:
"Begin failed!
1.Please recheck the "Protocol Type" in HUSKYLENS (General Settings>>Protocol Type>>I2C)
2.Please recheck the connection."
#include "HUSKYLENS.h"
HUSKYLENS huskylens;
void setup() {
Serial.begin(115200);
Wire.begin();
while (!huskylens.begin(Wire))
{
Serial.println(F("Begin failed!"));
Serial.println(F("1.Please recheck the \"Protocol Type\" in HUSKYLENS (General Settings>>Protocol Type>>I2C)"));
Serial.println(F("2.Please recheck the connection."));
delay(100);
}
}
I don’t have a HuskyLens 2 (I have the older ones), but one thing to note is that “x50” is indeed hexadecimal, not decimal - that's what the “0x” part indicates.
I suggest you run a simple I2C port scan to see which address your HuskyLens actually uses.
I ended up switching to an espressif esp32-s3 dev module and it's working fine.
However can I use the #include <Wire.h> library or is it only for arduino? Do I have to use the #include <esp_wifi.h> library?
Thank you in advance