Skip to content

Commit

Permalink
Merge pull request #15 from iamchriskelley/patch-5
Browse files Browse the repository at this point in the history
minor edits
  • Loading branch information
alexkrolick committed Nov 10, 2016
2 parents 15995c9 + ef376c9 commit f213fd1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions software/turbidimeter/voltagemeter.ino
@@ -1,4 +1,5 @@
/*--------------------------Voltage Meter Functions--------------------------*/
#define TEMP_PIN A4

float divisionFactor_TSL230R(){
float m = .0052; //slope of sensor's linear response curve
Expand Down Expand Up @@ -38,9 +39,9 @@ float getLightMultiplier(){
led_voltage = .0181 * getVoltageLevel() + 1.3376;
//calculate light intensity factor of LED due to voltage and current
li_multiplier = ((led_voltage - led_vi) * li_slope + li_base) / li_base;
temperature = readLM35Temperature();
float temp = readLM35Temperature();
//calculate light intensity factor of LED due to ambient temperature
temp_multiplier = 1 + (temperature - temp_base) * temp_slope;
temp_multiplier = 1 + (temp - temp_base) * temp_slope;
return li_multiplier * temp_multiplier;
}

Expand All @@ -52,3 +53,4 @@ float readLM35Temperature(){
analogReference(DEFAULT);
delay(200);
return t;
}

0 comments on commit f213fd1

Please sign in to comment.