#include <Arduino.h>
#include <HardwareSerial.h>
#include <SoftwareSerial.h>
#include "cmd/write.h"

SoftwareSerial cam_serial(3, 2);

void setup()
{
    Serial.begin(115200);
    cam_serial.begin(115200);
    cam_serial.listen(); // this isn't strictly nsessray
}

void loop()
{
    uint8_t buf[9];
    for (unsigned char i = 0; i < 100; i++)
    {
        uint8_t data[] = {i};
        command(*new Addr(FuncCommands::Brightness), data, 1, buf);
        cam_serial.write(buf, 9); // software serial automatically flushes

        delay(100);
    }
}
