Calibrating a sensor;

I cant wrap my head around how this freaking thing works, so this is a calibration code for photo resistor. sensorHigh=0; sensorLow=1023; while(millis<5000) { if (sensor>sensorHigh){ sensorHigh=potVal; } if (sensorVal<sensorLow){ sensorLow =potVal; } }} So if sensor is at 100, wouldnt both sensorLow and SensorHigh go to 100, by following the code. That Is what i think.
2 Replies
AnonEngineering
AnonEngineering2mo ago
calibration for an LDR? the LDR and a fixed resistor form a voltage divider, the output voltage is dependent on the values of the divider and the light hitting the LDR. typically you'd set a reasonable THRESHOLD value and see if the sensor output is higher or lower than that value
TheStudier
TheStudierOP2mo ago
taahnks

Did you find this page helpful?