Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
RobTillaart committed Sep 12, 2024
1 parent ee88f22 commit b4640b6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
32 changes: 16 additions & 16 deletions ML8511.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,34 @@ class ML8511
// if enablePin is omitted, one must connect EN to 3V3.
ML8511(uint8_t analogPin, uint8_t enablePin = 0xFF);

void reset(); // reset internal variables to initial value.
void reset(); // reset internal variables to initial value.

// energyMode = HIGH or LOW;
// returns mW per cm2
float getUV(uint8_t energyMode = HIGH);
float getUV(uint8_t energyMode = HIGH);

// for external ADC
// voltage must be >= 1.0 otherwise 0 is returned.
// returns mW per cm2
float voltage2mW(float voltage);
float voltage2mW(float voltage);

// voltage and steps must both be > 0 otherwise voltagePerStep
// is not set and the function returns false.
bool setVoltsPerStep(float voltage, uint32_t steps);
float getVoltsPerStep();
bool setVoltsPerStep(float voltage, uint32_t steps);
float getVoltsPerStep();

// manually enable / disable the sensor
// if enable pin is not set, device is always enabled.
bool enable(); // returns false if enable pin not set.
bool disable(); // returns false if enable pin not set.
bool isEnabled();
bool enable(); // returns false if enable pin not set.
bool disable(); // returns false if enable pin not set.
bool isEnabled();


// EXPERIMENTAL: estimate DUV index
// WARNING: USE WITH CARE
//
// input in mW per cm2 == typical the output of getUV()
float estimateDUVindex(float mWcm2);
float estimateDUVindex(float mWcm2);

// https://github.com/RobTillaart/ML8511/issues/4
// discusses the calibration
Expand All @@ -68,17 +68,17 @@ class ML8511
// a value of 1.61 was found to be far more accurate
//
// returns false if f < 0.01 (to force positive factor only)
bool setDUVfactor(float factor);
float getDUVfactor();
bool setDUVfactor(float factor);
float getDUVfactor();


private:
uint8_t _analogPin;
uint8_t _enablePin;
float _voltsPerStep;
bool _enabled;
uint8_t _analogPin;
uint8_t _enablePin;
float _voltsPerStep;
bool _enabled;

float _DUVfactor;
float _DUVfactor;
};


Expand Down
1 change: 1 addition & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ reset KEYWORD2

getUV KEYWORD2
voltage2mW KEYWORD2

setVoltsPerStep KEYWORD2
getVoltsPerStep KEYWORD2

Expand Down

0 comments on commit b4640b6

Please sign in to comment.