#pragma once
#include <Arduino.h>


struct PWMOUT{
  float max;
  bool visionCorrected;
  int resolution;
  int frequency;
};

class PWM_Output {
  public:
    float currDuty;
    bool visionCorrected;
    PWM_Output(int8_t pin, uint8_t ch, uint8_t res, uint32_t freq, float maxDuty, bool visionCorrected=false);
    void setOutput(float duty);
    void setFreq(uint32_t fq);
    int linearizeOutput(float inp);
    void setMaxDuty(float duty);
    int getOutVal(void);
    void setResolution(uint8_t res);
    float getMaxDuty(void) {
      return maxDuty;
    }

    int currOutVal;
  private:
    uint8_t ch;
    uint32_t freq;
    uint8_t res;

    float maxDuty;
    int msecRampRate;

    float standardFactor;
    float visionFactor;

};



