ECS-L Home Automation and Security Archives
  learn more | view messages for this month | NetBloc® | terms of use | search

Google
 


  subject (prev) or (next) | time (prev) or (next) | author (prev) or (next) | view more subjects

Subject:
From:
Date:
RE: [ECS] Help Reading in Analog Values
gbailey
Tue, 13 Oct 1998 19:05:17 -0600

To multiply by 1.961, the best and fastest way is to find an equivalent
fraction and do a simple multiply followed by a divide. If you multiply your
sensor reading by 196 and then divide by 100 you will be close. Assuming of
course that yolur sensor reading is low enough that the multiplication does
not overflow the calculation. If it does, you may be able to do the division
first.
If none of that works, you will have to use the A*B/C provision.


----------
From: 	J Gary Mull[SMTP:jgary@mindspring.com]
Reply To: 	ecs-list@vancouver.ml.org
Sent: 	Monday, October 12, 1998 10:11 PM
To: 	ecs-list@vancouver.ml.org
Subject: 	[ECS] Help Reading in Analog Values

I am trying to read in temperature on ECS and I do not know how to do the
calculation using the ECS 32 bit arithmetic.

If I simply multiply the value of the ouput of the analog sensor by 2 I am
overstating the temperature several degrees.  What I need to do is mutiply
the value times 1.961 to get an average temperature.  I do not know how to
set up an ECS event with the 32 bit arithmetic.

I have an example from 12 bit at 5 volts but it does not work for my 8 bit.
Any help would be appreciated.

        Gary

Info from HV
Info from HV


The analog inputs operate from 0 to 5 VDC and provide 8-bit resolution.
When an analog input is read, the voltage is converted into a value between
0 and 255 (00h to FFh).  This gives a resolution of 19.61mV (5V ÷ 255
steps).  To determine the actual voltage from the value read in, multiply
the value by 19.61mV.



jgary@atl.mindspring.com   Gary at Home
jgmull@us.ibm.com          Gary at Work

--
To unsubscribe, e-mail: ecs-list-unsubscribe@vancouver.ml.org



  subject (prev) or (next) | time (prev) or (next) | author (prev) or (next) | view more subjects




Services provided by [NetBloc]®! NetBloc Solutions Inc.
Terms of use. Indexing software (c) 1999 Lin-De, Inc
.