I found this code. But I can't find the <HuskyLensBlock.h> library anywhere.
Code:
#include <Wire.h>
#include <HuskyLensBlock.h>
HuskyLensBlock huskyLens;
void setup() {
Serial.begin(115200);
Serial.println("Starting");
Wire.begin();
while (!huskyLens.begin(Wire))
{ Serial.println("Waiting for HuskyLens to begin.");
delay(1000);
}
huskyLens.writeAlgorithm(ALGORITHM_FACE_RECOGNITION); // Nastavení algoritmu na rozpoznávání obličeje
huskyLens.writeFrameLength(FRAME_640x480); // Nastavení velikosti rámce }
void loop()
{
Serial.println("Number of blocks: " + String(huskyLens.getNumberOfBlocks()));
if (huskyLens.request())
{
for (int i = 0; i < huskyLens.getNumberOfBlocks(); ++i)
int x = huskyLens.getX(i);
int y = huskyLens.getY(i);
int width = huskyLens.getWidth(i);
int height = huskyLens.getHeight(i);
Serial.println("Block " + String(i) + ": (" + String(x) + ", " + String(y) + ", " + String(width) + ", " + String(height) + ")");
} } }