Pages: [1]   Go Down
Author Topic: scale/resistance voltage for pin (0)  (Read 685 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am wanting to get reading from a temp sending unit,  voltage is scaled 0-5v  and resistance  is from 13.5k  to  20ohms.
I  know pin0  can  read 1024  different  levels, I only want to break this into 4 or 5 sections , example  only know if  it is  >2500 , <2500 but > 450,  etc. or could I  do it a different way and measure the voltage?  >1v  but  < 3v?
   I am using  an arduino mega 2560 and  pololu vnh5019. I am trying to  use these readings to  drive an actuator to  4 or 5 different positions depending upon temp.
 Could anyone help me with this? I hope I explained it correctly.
« Last Edit: October 16, 2012, 04:25:52 am by jlb37330 » Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 613
Posts: 49319
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The value returned by analogRead() is indeed in the range of 0 to 1023. You can use the map() function to map that to a different range. Or, a series of if/else if/else statements can select non-uniform ranges, if that works better.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 Thank you.
Logged

Pages: [1]   Go Up
Jump to: