Huskylens object classification switched in code
![userHead](https://dfimg.dfrobot.com/dfPortrait2.png)
With Huskylens, can “object classification” be switched in code (Arduino) like all the other functions - i.e. go from “face recognition” to “object classification” with a few lines of code?
If so, could you please show the code required?
Many thanks for any help, it is much appreciated.
Tony
This is using the Arduino API:
#include "HUSKYLENS.h" //Import the required libraries
HUSKYLENS huskylens; //Create a new Huskeylens object
int ID1 = 1;
void setup()
{
Serial.begin(115200); //Start serial communication
Wire.begin(); //Connect to Huskylens
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);
}
huskylens.writeAlgorithm(ALGORITHM_OBJECT_CLASSIFICATION);
…
Later, when you want facial recognition, you would do something like the following line:
huskylens.writeAlgorithm(ALGORITHM_FACE_RECOGNITION);
It is very easy to use the Arduino API.
![userHeadPic](https://dfimg.dfrobot.com/6089c874aa9508d63a41376e/shop/123c58593b7c63b7bb61b829ea4ae97a_50x50.jpg)