day in my life — Esp32 Devkit C V4 simulation

An interactive Esp32 Devkit C V4 circuit simulation you can run free in your browser on Velxio, by kiybiy36.

Components

Sketch code

#ifndef HUSKYLENS_H
#define HUSKYLENS_H

#include <Arduino.h>
#include <Wire.h>

#define COMMAND_REQUEST 0x20
#define COMMAND_RETURN_INFO 0x29
#define COMMAND_RETURN_BLOCK 0x2A
#define COMMAND_RETURN_ARROW 0x2B

struct HUSKYLENSResult {
    int command;
    int xCenter;
    int yCenter;
    int width;
    int height;
    int ID;
};

class HUSKYLENS {
private:
    TwoWire* _wire;
    uint8_t _address = 0x32;
    HUSKYLENSResult _result;
    bool _available = false;

    void sendCommand(uint8_t cmd);

public:
    bool begin(TwoWire& wire);
    bool request();
    bool isLearned();
    bool available();
    HUSKYLENSResult read();
};

#endif

More projects by kiybiy36