Main Site Documentation

Analogin how much voltage is "1" on the ADC?


#1

Hello guys,

This might seem a strange question, but if I read “1” on the ADC while reading a analog pin, how much voltage is this representing?

According arduino forums, a arduino has 0.00488V when reading “1” on the analog pin.

So how much is this on the FEZ boards?

And how much voltage can I place on the analog in?

Thanks! ;D


#2

It depends on your scale value. (Arduino doesn’t have built in scaling ;))

So set scale to 3300 and knowing the input voltage is 3.3V, it is 1mv per 1


#3

Thank you, will try it out tomorrow 8)


#4

But then again Arduino has the map function built in that could be used for scaling :wink:
(Thats an easy function to implement but I would like to see it as a built in function :slight_smile: )


#5

Maybe add your map function to fezzer? Should be couple lines of code, right?


#6

As you say, it’s not much code


private uint map(int x, int in_min, int in_max, int out_min, int out_max)
{
   int Puls = (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
   return (uint)Puls;
}

We had a thread on this earlier http://www.tinyclr.com/forum/1/828/
I’ll add it to Fezzer tomorrow.


#7

Yeah it is small but not everyone knows how to make it. Thanks Geir