Go Down

Topic: Calibrating sensors - should be easy? (Read 514 times) previous topic - next topic

tomski

Hi,
Whats the equation for constraining a variable to a specific scale i.e. I have a light sensor that outputs an analog read value between 200 - 800 which I want to convert to a scale of 0-255
Ta for any help:)
Tom

tomski

OK found this:
http://www.arduino.cc/playground/Main/Fscale

which will convert one scale to another, but this seems like overkill as im only using integers - I do wish I was better at maths;)

Tom

wayoda

Here is the integer-version of the scale function you where looking for...
http://www.arduino.cc/playground/Main/Autoscale

Never used it myself, I simply knew by accident it was somewhere on the playground...

Eberhard

tomski


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy