View Single Post
Old 06-10-2015, 07:51 AM   #56 (permalink)
bobski
EcoModding Apprentice
 
Join Date: Jan 2010
Location: Newark, DE
Posts: 143

'91 CRX - '91 Honda CRX DX
90 day: 34.91 mpg (US)
Thanks: 0
Thanked 14 Times in 14 Posts
Quote:
Originally Posted by Theitguy View Post
where you have "analogin > 120" is this your voltage value??
The 10-bit representation of it, yes. When you run analogRead(pin#), it uses the ATMEGA's ADC to measure the voltage of that pin as a 10-bit (0-1023) value.

Here's the resistor layout I used: http://ecomodder.com/forum/showthrea...tml#post227420

You'll want to set the if{} values half way between the nominal analogRead values. In the case of the schematic you attached: 70, 240, 415, 620 and 880 would be good middle-values.

Last edited by bobski; 06-10-2015 at 08:04 AM..
  Reply With Quote